[英]how do i get windows to execute .py with specific `python.exe`?
i tried in Control Panel\\Programs\\Default Programs\\Set Associations
, and also assoc
/ ftype
, but windows keeps using the wrong python.exe
( C:\\Python27\\
) instead of the one i want ( C:\\Users\\nlab\\Downloads\\WinPython-64bit-2.7.9.5\\python-2.7.9.amd64\\
) 我在Control Panel\\Programs\\Default Programs\\Set Associations
以及assoc
/ ftype
尝试过,但是Windows一直使用错误的python.exe
( C:\\Python27\\
)而不是我想要的那个( C:\\Users\\nlab\\Downloads\\WinPython-64bit-2.7.9.5\\python-2.7.9.amd64\\
)
>where python
C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\python.exe
C:\Python27\python.exe
C:\Program Files (x86)\LilyPond\usr\bin\python.exe
>assoc .py
.py=Python.File.WinPython
>ftype Python.File.WinPython
Python.File.WinPython=C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7
.9.amd64\python.exe "%1" %*
>set PATH
Path=C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64;...C:\Python27;C:\Python27\Scripts;...C:\Program Files (x86)\LilyPond\usr\bin;...
PATHEXT=.PY;...
i just made up Python.File.WinPython
, is that allowed? 我刚刚组成了Python.File.WinPython
,允许吗?
https://github.com/winpython/winpython/wiki/Installation#Registration https://github.com/winpython/winpython/wiki/Installation#Registration
(but you will loose your python2.7 registration if you do that) (但如果这样做,您将失去python2.7注册)
the other solution is : 另一个解决方案是:
call C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\scripts\env.bat
python my_progam_.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.