The Pickle saver!
Pickle is a module in python that can save data locally!
let's start by importing this module,
then lest make a variable
x = 10.
Now we are going to save this data first make a
save.dat file then put this in the python file,
save = open('save.dat', 'wb') pickle.dump(x, save) # this will dump it into that file save.close()
this will open the
save.dat file in a variable!
then if you go to your
save.dat file you will see lots of gibberish, this is because it saves it in a special language!
now to open:
load = open('saver.dat', 'rb') data = pickle.load(load) x = data load.close()
this open the file and then save the data in
x, and it will still be a number!
You can also do ,
ctrl or command + shift + s for open then terminal and put this in it
pip install Saver(this is my package to help you!)
Then you can do
saver.save(x, 'save.dat') and it will save it then do
saver.load('save.dat') to open!