I am implementing a login system to a program I am writing and have hit a snag- I cannot seem to make a variable retain the same value across all files. I am working in python.
I have made a file named config.py and set the variable to false there
validated = False
in the file main.py I have called config.py and written an if statement-
import window
import config
...
if config.validated == True:
print(config.validated)
finally in the file named window.py, which deals with the login system- I have written a statement to make validated true, the idea being it changes validated in config.py to true which then allows the script to run, the previous part is only set as print (config validated) to test it as the full script was becoming laborious to keep dealing with.
import config
...
if passwordcheck == users[usernamecheck]:
config.validated == True
the program wont respond, I'm not getting any error messages. it seems as though validated wont change to true across all files, anyone have any idea what I'm missing?
EDIT
if passwordcheck == users[usernamecheck]:
config.validated = True
elif passwordcheck !=users[usernamecheck]:
tkinter.messagebox.showerror("error", "Password is incorrect")