Skip to content
Revilo0509 edited this page Oct 30, 2024 · 5 revisions

Basic Functions

save(name,data)

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 as

Incase the variable already exists save() updates it instead of making a new one

load(name)

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.

remove(name):

Removes a specified variable. For example

remove("GoodName")

misc functions

listVariables()

Prints and returns all stored variables.

DANGER FUNCTIONS

clearAllVariables()

WARNING USE WITH CAUTION, REMOVES ALL STORED VARIABLES

removeVariableFile()

WARNING USE WITH EXTREME CAUTION, REMOVES THE VARIABLE FILE