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

前端 未结 6 1932
误落风尘
误落风尘 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:34

    Similar trouble for me just now, in my first week with python. But I dimly remembered a similar problem with a simple early test script and thought the trouble then was # comments. So I tried that with my Tkinter infused .py script. It ran fine in IDLE as you say, then only flashed when clicked in windows. But there were a couple # commented lines at the top of file.

    I took them all out and it now runs no sweat directly in windows. Have a look .. for #.

    Sorry, can't seem to delete this post. Now the files work #comments included. Don't know what's up with that. ..

提交回复
热议问题