Script works in IDLE, but .py-file doesn't work

前端 未结 6 1934
误落风尘
误落风尘 2020-12-31 17:40

I have a tkinter script, which runs just fine in IDLE. However, when I double click the .py-file from Windows Explorer, the console window flashes half a second and then it

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 18:26

    I found that changing the executable py file to a file.pyw fixed the problem. This tells python to execute it using the pythonw.exe which runs the script without the terminal/console in the background.

    Not sure why this works, perhaps some screwed up environment variables from a previous python installation.

提交回复
热议问题