Re: Generate alphabet?

2008-08-23 Thread Leo Jay
On Sat, Aug 23, 2008 at 6:02 AM, ssecorp <[EMAIL PROTECTED]> wrote: > In Haskell I can do [1..10] for range(1,11) and ['a'..'z'] for a list > of the alphabet. > > Is there a way in Python to generate chars? > how about: >>> import string >>> ','.join(string.ascii_lowercase) 'a,b,c,d,e,f,g,h,i,j,k,

Re: Generate alphabet?

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 6:02 PM, ssecorp <[EMAIL PROTECTED]> wrote: > .['a'..'z'] for a list of the alphabet. > > Is there a way in Python to generate chars? Not as nice as in Haskell (or other languages), but: [chr(i) for i in xrange(ord('a'), ord('z')+1)] Regards -- http://mail.python.org/mai

Re: Generate alphabet?

2008-08-22 Thread Emile van Sebille
ssecorp wrote: In Haskell I can do [1..10] for range(1,11) and ['a'..'z'] for a list of the alphabet. Is there a way in Python to generate chars? How about: def haskellrange(sc,ec): if type(sc) is int: for ii in range(sc,ec): yield ii else: for ii in range(

Re: Generate alphabet?

2008-08-22 Thread Wojtek Walczak
On Fri, 22 Aug 2008 15:02:19 -0700 (PDT), ssecorp wrote: > In Haskell I can do [1..10] for range(1,11) and ['a'..'z'] for a list > of the alphabet. > > Is there a way in Python to generate chars? It's not actually about generating anything, but why should one generate something if it's accessible

Generate alphabet?

2008-08-22 Thread ssecorp
In Haskell I can do [1..10] for range(1,11) and ['a'..'z'] for a list of the alphabet. Is there a way in Python to generate chars? -- http://mail.python.org/mailman/listinfo/python-list