python - 包含tkinter的py文件闪退
伊谢尔伦
伊谢尔伦 2017-04-17 17:54:13
0
3
1265
from tkinter import *
ro = Tk()

python3.4,windows8.1 *64

这句话在交互命令行里是可以执行的,在IDE里也没报错,只是双击打开就会闪退。

在.py里使用其他的都可以正常打开,但是再用tkinter时就会闪退,请问这是为什么?如何解决? 谢谢

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(3)
巴扎黑

There is no raw_input() in python3. If an error occurs, an exception will be thrown. If it is not handled, it will exit

PHPzhong

You saved the .py file and directly double-clicked it to execute it?

The above code is problematic, but the crash prevents you from even seeing the error message.

So, you have to use the correct posture to open the .py 文件,在 Windows file. Under Windows, it is best to do this:

After executing this, you will see the output and error information in another window.

洪涛
from tkinter import *
ro = Tk()
ro.mainloop()

Try adding the last line

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!