2016-11-17 54 views
-1

我正在使用原子编辑器。我使用脚本包,atom runner包等来执行python脚本,但是当我尝试执行基于tkinter(GUI)的脚本时,不显示输出。它只是说成功。现在,有没有办法使用atom来执行python GUI脚本?如何从原子编辑器执行python脚本?

+0

通常'tkinter'的脚本需要在末尾运行'root.mainloop()'。 IDLE也使用'tkinter',所以它运行自己的'root.mainloop()'和IDLE中的其他'tkinter'脚本可以在没有'root.mainloop()'的情况下运行。但是你应该总是使用'root.mainloop()' – furas

+0

完美工作。谢谢你,朋友。 –

+0

@furas:将您的解决方案作为答案发布将非常好,因此Madhu将其标记为可以解决未解答队列中的问题。 – nyedidikeke

回答

1

正常情况下,使用tkinter的脚本需要root.mainloop()才能运行。 IDLE使用tkinter,所以它运行自己root.mainloop()和其他tkinter脚本IDLE可以运行没有root.mainloop()。但是您应该始终使用root.mainloop()