Richard D. Moores wrote:

But I'd like to put the lines of the dictionary in a text file so that
I can add key/value items to it by writing to it with another script.

If you expect human beings (yourself, or possibly even the user) to edit the text file, then you should look at a human-writable format like these:


Good ol' fashioned Windows INI files:
    import configparser
JSON:  import json
PLIST: import plistlib
YAML:  download from http://pyyaml.org/wiki/PyYAML


If the ability to edit the files isn't important, then I suggest using the pickle module instead.





--
Steven

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to