Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何关闭一个 gtk 窗口并打开另一个(python)?我试过这样的事情:
gtk.main_quit() #or window.destroy() os.system("./script.py") #there is working code with gtk window in it
但第一个窗口没有关闭。我在任何地方都找不到合适的解决方案。任何帮助将不胜感激。
会导致你的gtk.main_quit()应用退出,相当于写:
gtk.main_quit()
print('some line') exit(0) print('some other line which will never get printed')
相反,您应该首先隐藏窗口,然后显示另一个窗口,最后调用gtk.main_quit()关闭您的应用程序。