函数加载在终端上,而不是在加载tkinter GUI之后


enter code here
def validator ():
if desAddress.get()=='' and sourceAddress.get()=='' :
messagebox.showwarning('Validator','Please enter the source address n Enter destination address')
elif sourceAddress.get()=='':
messagebox.showwarning('Validator','Please enter the source address')
elif desAddress.get()=='':
messagebox.showwarning('Validator','Please enter the destination address')
def exe():
os.system('python class_runner.py')
funVariable=lambda:validator(),exe()
enter code here

上面的代码让我非常头疼。myfunVariable加载在终端上,而不是在点击阻止我的tkinter窗口加载的按钮后加载。

已解决。代码的问题是我在顶部导入了.py文件,这阻止了代码的运行。解决。

最新更新