我在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;...
我刚刚编造Python.File.WinPython
,是允许的吗?
答案 0 :(得分:0)
https://github.com/winpython/winpython/wiki/Installation#Registration
(但如果你这样做,你将失去你的python2.7注册)
另一个解决方案是:
call C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\scripts\env.bat
python my_progam_.py