Answer the question
In order to leave comments, you need to log in
How to save with pickle?
there is a stats dictionary and a save.txt file. You need to save and load this file through pickle. I'm probably stupid, but I've been sitting with this garbage for the second evening and this is what happened
stats = {1 : 2,2 : 3}
save = open("save.txt","w")
with open(save,"w") as save:
pickle.dump(stats,save)
Answer the question
In order to leave comments, you need to log in
import pickle
stats = {1 : 2,2 : 3}
with open("save","wb") as save:
pickle.dump(stats,save)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question