Using Pickle To load serialized Objects from file In Python - String Deserialization
Once you have pickled some data and saved to a txt file, you may want to retrieve the data back to a valid and usable python object at run time.
To restore an object to memory, just load the file using pickle, assigning the value to the object itself.
post this code
# The file with serialized data to retrieve
fileHandler = open(filename, 'r')
# The data is stored into my_object variable
my_object = pickle.load(fileHandler)
If you want to be updated about similar snippets,
and follow our Channels