我在IDE中的pythonshell和Tkinter窗口之间遇到问题。我要做的是把我所有的用户输入都放在shell中,然后在Tkinter窗口中输出相应的信息。在
但是,当我的窗口被创建并弹出时,我关闭它以在shell中继续我的程序,然后继续输入。但是,当我尝试重新初始化我的窗口时。上面说窗户已经被毁坏了。我明白这意味着什么,所以我尝试了一个顶层窗口,在这个窗口中我可以输出我的信息,并隐藏我的根窗口,但shell不会继续,直到我关闭/销毁根窗口。在
有没有一种方法可以在不破坏根窗口的情况下继续在shell中运行?我对这门语言相当陌生,所以如果有任何帮助,我将不胜感激。在
这是我的总体想法:from Tkinter import *
#get all my info from the shell
root = Tk()
root.withdraw() #hide the root window
main = Toplevel()
#this is the window that I want to be able to close and open later
#get more info from the shell after main is closed
#now I want to open the updated main window
提前谢谢!(如果重要的话,我正在研究Windows)