簡體   English   中英

我如何讓Windows使用特定的`python.exe`執行.py?

[英]how do i get windows to execute .py with specific `python.exe`?

我在Control Panel\\Programs\\Default Programs\\Set Associations以及assoc / ftype嘗試過,但是Windows一直使用錯誤的python.exeC:\\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 ,允許嗎?

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM