I have a basic dict as follows:
sample = {}
sample[\'title\'] = \"String\"
sample[\'somedate\'] = somedatetimehere
I faced this issue today, I found something called pickle
. It's a built-in library for serializing python objects and also load it from a pickle file.
The only difference I found between pickle
and json
is pickle
file is a binary file, where as json
is a usual text file.
And It doesn't cause any issues with datetime objects.