How do I have to configure so that I don't have to type python script.py but simply script.py in CMD on Windows?
I added my python directory to %PATH% that contains python.exe but still scripts are not run correctly.
I tried it with django-admin.py Running django-admin.py startproject mysite gives me
Type 'django-admin.py help ' for help on a specific subcommand. Using python in front of it processes the command correctly.
What's the problem here?
解决方案C:\> assoc .py=Python
C:\> ftype Python="C:\python27\python.exe %1 %*"
Or whatever the relevant path is - you can also set command line args using ftype.
In order to make a command recognized without having to give the suffix (.py), similar to how it works for .exe files, add .py to the semi-colon separated list of the (global) PATHEXT variable.