create lowercase strings in lists
create lowercase strings in lists - was: (No subject)
Steven Bethard steven.bethard at gmail.comFri Dec 17 04:49:09 EST 2004
- Previous message (by thread): Python RSS aggregator?
- Next message (by thread): create lowercase strings in lists - was: (No subject)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Mark Devine wrote: > the trouble is it throws up the following error for set: > > $ ./test.py > Traceback (most recent call last): > File "./test.py", line 23, in ? > reflist = [normalize(element) for element in list1] > File "./test.py", line 20, in normalize > return set(text.split()) > NameError: global name 'set' is not defined > The set type became a builtin in Python 2.4. I would suggest upgrading, but if this is not an option, you can put this at the top of the file, and it should get rid of the NameError: from sets import Set as set Steve
- Previous message (by thread): Python RSS aggregator?
- Next message (by thread): create lowercase strings in lists - was: (No subject)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list