Windows 7,cmd:
C:\>python
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\>python.exe
(works)
C:\>bash
'bash' is not recognized as an internal or external command,
operable program or batch file.
C:\>bash.exe
(works)
ETC...
有没有办法让我在输入“python”时运行 python.exe?
答案1
确保.exe
在你的%PATHEXT%
:
C:\>set pathext
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.py;.pl
当您运行时python
,Windows 会尝试该环境变量中列出的所有扩展。
C:\>set pathext=.exe;%pathext%