Skip to content

Commit

Permalink
Create save.py
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sussy-impostor authored May 3, 2024
1 parent 7870ada commit 996df26
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions save.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pickle

def save(key,data):
with open("savedata.pk","rb") as f:
g = pickle.load(f)
g[key] = data
with open("savedata.pk","wb") as f:
pickle.dump(g)
# del f,g

def load(key):
with open("savedata.pk","rb") as f:
pickle.load(f)
# del f
try:
return pickle[key]
except:
return

0 comments on commit 996df26

Please sign in to comment.