Python .pyw extension does not work

与世无争的帅哥 提交于 2021-02-11 01:32:54

问题


I'm trying to run a program without cmd window pop-up when I double click it or when I make it exe. So I wanted to save it as .pyw extension but when I double click to script, shell can't run it. It says I need to select the program to run it or search online. How can I fix this? Windows- Python 3.4

It was okay in 3.5 when I use .pyw extension. First time I see this problem.


回答1:


I always have this problem whenever I reinstall Python.

Very simple fix (at least on Windows):

1) Create a .pyw file

2) Right-click on it and select properties

3) In "Opens with:" press change

4) Navigate to your python directory and choose "pythonw.exe"



来源:https://stackoverflow.com/questions/37149454/python-pyw-extension-does-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!