Python .pyw扩展名不起作用 [英] Python .pyw extension does not work

查看:52
本文介绍了Python .pyw扩展名不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我双击该程序或将其设置为exe时,我正在尝试运行没有cmd窗口弹出的程序.所以我想将其保存为.pyw扩展名,但是当我双击脚本时,shell无法运行它.它说我需要选择程序才能运行它或在线搜索.我怎样才能解决这个问题?Windows- Python 3.4

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

当我使用.pyw扩展名时,在3.5中还可以.我第一次看到这个问题.

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

推荐答案

每当我重新安装Python时,我总是遇到这个问题.

I always have this problem whenever I reinstall Python.

非常简单的修复程序(至少在Windows上是这样):

Very simple fix (at least on Windows):

1)创建一个.pyw文件

1) Create a .pyw file

2)右键单击它并选择属性

2) Right-click on it and select properties

3)在打开方式:"中,按更改

3) In "Opens with:" press change

4)导航到您的python目录,然后选择"pythonw.exe"

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

这篇关于Python .pyw扩展名不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆