Writing dictionary to file
Dan Schmidt
dfan at harmonixmusic.com
Fri Sep 8 09:52:30 EDT 2000
More information about the Python-list mailing list
Fri Sep 8 09:52:30 EDT 2000
- Previous message (by thread): Writing dictionary to file
- Next message (by thread): Writing dictionary to file
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Stephen Kloder <stephenk at cc.gatech.edu> writes: | To write dictionary dict to file f: | | from string import join | f.write(join(map(lambda x:"%s %s"%x,dict.items()),'\n')) Or, in Python 2.0, f.write(join([("%s %s" % x) for x in dict.items()],'\n')) Yours for list comprehensions, Dan -- Dan Schmidt | http://www.dfan.org Honest Bob CD now available! | http://www.dfan.org/honestbob/cd.html
- Previous message (by thread): Writing dictionary to file
- Next message (by thread): Writing dictionary to file
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list