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
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.
If you want to run a file separately without importing it do this.
from os import system
#system calls a command from terminal
system("python <path to python file>")