Im trying to run another file from my tkinter login system but i cant find the way to do it
Ive tried import file
if (p == '123') and (u == 'test'): import correct Im trying to run the file when those are true
One hacky way to do it, if you really have to is this:
with open("correct.py", "r") as f: exec(f.read()) But you should avoid doing this if possible. Normally it is better import the file and run a function from it.
ifstatement (though what you wrote should technically work if that file contains global code, so I guess you've got some other problem in your code).os.system('py your_module.py')