首页 > 解决方案 > 我的文件仍在运行,但它不应该运行

问题描述

我试图在函数中导入文件,但它并没有停止运行。这是我的代码的一部分:

def imp():
    root.withdraw() #"root" is the window I created earlier in the code
    import file1 #some tkinter stuff
    root.deiconify()
 
but=tk.Button(root,text='Run',command=imp)
but=pack(side=tk.BOTTOM)

在“file1.py”中点击按钮并关闭窗口后,“root”不会弹出。有谁知道为什么?我想不出办法解决它,请任何人帮忙。

对不起,如果我有什么不清楚的地方。

标签: pythontkinter

解决方案


推荐阅读