It’s a trivial mistake: pickle.dump(obj,file)
takes a file
object, not a file name.
What I need is something like:
with open("a-file.pickle",'wb') as f:
pickle.dump({"a dict":True},f)
It’s a trivial mistake: pickle.dump(obj,file)
takes a file
object, not a file name.
What I need is something like:
with open("a-file.pickle",'wb') as f:
pickle.dump({"a dict":True},f)