-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Revilo0509 edited this page Oct 30, 2024
·
5 revisions
Needs two arguments name and data. It is the same as a normal variable you give it a name and then assign it data. For example
save("GoodName", int(3.14)) # the int() is needed because if it isn't there it won't know what type to save it asIncase the variable already exists save() updates it instead of making a new one
Needs a single argument, Name. It will find the variable in the save file then return it. You can use it like
Variable = load("GoodName") # Note: the variable you name it as in the program does not need to match the one in the save file.For loading variables in the start of a program I recommend using the try: statment. For example
try:
Variable = load("GoodName")
except Exception:
Variable = 10 # Here you assign it the initial value for when there isn't a variable already in the save file.
# REMEMBER: You need to use the save() at the end of your program incase your variable changes.Removes a specified variable. For example
remove("GoodName")Prints and returns all stored variables.
WARNING USE WITH CAUTION, REMOVES ALL STORED VARIABLES
WARNING USE WITH EXTREME CAUTION, REMOVES THE VARIABLE FILE