Help on dictionaries...

Michael Torrie torriem at gmail.com
Wed Jan 29 20:51:50 EST 2020


On 1/29/20 6:14 PM, Souvik Dutta wrote:
> Hey I was thinking how I can save a dictionary in python(obviously) so that
> the script is rerun it automatically loads the dictionary.

You could use the pickle module for that. See the python.org
documentation on pickle.

Alternatively you could use a json library to write the dict to disk.  I
think this might be preferable to pickle in many situations.

Or serialize the data yourself to a file.



More information about the Python-list mailing list