[Tutor] passing dictionaries through a file

Doug Basberg dbasberg at comcast.net
Mon Mar 16 21:39:06 CET 2015


I would like to pass the contents of a dictionary from one program to
another through a file.  So, what is the elegant way to pass a dictionary by
file?  My early learning about Python seems to indicate that only ascii is
easily passed in files.  I am using Python 2.7.4 now.  Should I be learning
one of the serialization methods?  Can I use ascii in the file and easily
put that back into a dictionary in the file read program?

I will be very happy to hear alternatives that I can read about and learn
more about Python.  In C++, I was very happy using structs and classes with
serialization.  Is the Python solution somewhat similar to C++?

Thanks, Doug



More information about the Tutor mailing list