Re: [Tutor] Off-Topic - Mutt and mailing lists

2007-06-11 Thread Simon Hooper
Hi Michael,

* On 11/06/07, Michael Klier wrote:
> Alan Gauld wrote:
> > I'm not surecwhy but your messages are coming through to me 
> > as text attachments which makes quoting them tricky...
> 
> Hmmm, I did a group reply in mutt the last time, lets see if a direct
> reply and manuall CC: works right.

I don't know if you are aware, but mutt has a great list-reply command
(bound to L by default) which "does the right thing" for mailing lists.
Look up list-reply in the mutt manual.

HTH

Simon.

-- 
Simon Hooper
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] iterating over a sequence question..

2007-06-18 Thread Simon Hooper
Hi Luke,

* On 17/06/07, Luke Paireepinart wrote:
> a more expanded version that accounts for either list being the longer 
> one, or both being the same length, would be:
> 
>  >>> if len(t) > len(l): x = len(t)
> else: x = len(l)
>  >>> print [(l[i%len(l)],t[i%len(t)]) for i in range(x)]
> [(1, 'r'), (2, 'g'), (3, 'b'), (4, 'r'), (5, 'g')]

Being the duffer that I am, I'm very pleased with myself that I came up
with a similar solution (albeit as a function rather than a list
comprehension) :)

You do not need the if statement either,

print [(l[i%len(l)],t[i%len(t)]) for i in range(max(len(l), len(t)))]

Regards

Simon.

-- 
Simon Hooper
PARTEX MARKING SYSTEMS UK LTD
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor