如何在 XP 中更改 .py Python 文件的文件关联?

发布于 2024-12-17 04:06:52 字数 263 浏览 5 评论 0原文

当我输入 assoc .py 时,我得到 .py=py_auto_file。 当我输入 ftype py_auto_file 时,我得到 py_auto_file="C:\Program Files\Adobe\Photoshop 7.0\Photoshop.exe" "%1"

How do I make py_auto_file="C:\Python27"

When I type assoc .py I get .py=py_auto_file.
When I type ftype py_auto_file I get py_auto_file="C:\Program Files\Adobe\Photoshop 7.0\Photoshop.exe" "%1"

How do I make py_auto_file="C:\Python27"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

悲欢浪云 2024-12-24 04:06:52

Photoshop 似乎可以识别 .py 文件格式,并将“py_auto_file”与 .py 扩展名相关联。

您可以使用以下命令来查找 python 文件类型:

C:\>ftype | findstr -i python
Python.CompiledFile="C:\Python27\python.exe" "%1" %*
Python.File="C:\Python27\python.exe" "%1" %*
Python.NoConFile="C:\Python27\pythonw.exe" "%1" %*

下一个命令显示我的系统中的正确关联:

C:\>assoc | findstr -i python
.py=Python.File
.pyc=Python.CompiledFile
.pyo=Python.CompiledFile
.pyw=Python.NoConFile

您可以使用以下命令修复关联:

assoc .py=Python.File
assoc .pyc=Python.CompiledFile
assoc .pyo=Python.CompiledFile
assoc .pyw=Python.NoConFile

It appears Photoshop may recognize a .py file format and has associated "py_auto_file" with the .py extension.

You can use the following command to locate the python file types:

C:\>ftype | findstr -i python
Python.CompiledFile="C:\Python27\python.exe" "%1" %*
Python.File="C:\Python27\python.exe" "%1" %*
Python.NoConFile="C:\Python27\pythonw.exe" "%1" %*

The next command shows the correct associations from my system:

C:\>assoc | findstr -i python
.py=Python.File
.pyc=Python.CompiledFile
.pyo=Python.CompiledFile
.pyw=Python.NoConFile

You can fix the associations with the following commands:

assoc .py=Python.File
assoc .pyc=Python.CompiledFile
assoc .pyo=Python.CompiledFile
assoc .pyw=Python.NoConFile
神爱温柔 2024-12-24 04:06:52

您应该将脚本名称 %1 和所有命令行参数 %* 传递给 Python27 可执行文件。为此,只需执行

ftype py_auto_file="C:\Python27\bin\python.exe" "%1" %*

You should pass script name %1 and all command-line parameters %* to Python27 executable. To do this, simply execute

ftype py_auto_file="C:\Python27\bin\python.exe" "%1" %*
不如归去 2024-12-24 04:06:52

右键单击 .py 文件并将默认程序设置为 python.exe

Right-click on .py file and set default program as python.exe

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文