so right now i have a bot that will change a boolean if something is happening. Now i'm also using API to this bot, so it's not impossible that there is going to be a connection error, so what i want the bot to do is to remember if the bot already change boolean of "x" to False/True instead of the default boolean value when Exceptions occured. My code looks something like this:
def boolean():
try:
x = False
if x == False:
if a >= b:
do = something
x = True
elif x == True:
if a <= b:
do = something
x = False
now that's my code, so when there's connection problems, i put an Exceptions code so that the program will try and try again to run "def boolean()", so the code looks something like this:
except Exceptions as e:
print(e)
time.sleep(10)
boolean()
and here is where i need helps, because if the bot already change the boolean of "x" to "True" and then there's connection error occured, and then the program restart again, then "x" will be set to default boolean value which is "False" and i don't want that to happen, so what i want is the program to remember if it already change the boolean of "x" or not. I'm stuck with this problems so i need your help.