Python's qw

Erik Max Francis max at alcyone.com
Fri May 16 03:34:16 EDT 2003


A Puzzled User wrote:

> Since Python doesn't have qw, is the following a
> proper/usual way to simulate it?
> thanks.
> 
>  >>> a = """sunflower
> tulip
> jasmine"""
> 
>  >>> string.split(a, "\n")
> ['sunflower', 'tulip', 'jasmine']

I've seen similar things used [e.g., 'sunflower tulip jasmine'.split()],
so it's not uncommon.  I prefer the old fashioned way, myself.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ Hate come gratis / I connected every kind
\__/  Lamya




More information about the Python-list mailing list