开发者

.py files opens up in a text editor when run from cmd

Whenever I try to run a .py file from cmd it opens up in a text editor(np++). I'm trying to run the foll开发者_开发百科owing:

django-admin.py startproject testprj

Even if I run 'setup.py install'


You need to change the file association so that .py files open with Python executable, typically located in C:\Python<version>\ and not Notepad++

Changing this should be easy, but here is how to do it.

Also, read here on to set the environment path so that the Python executable is found without you having to navigate to C:\Python2.6.


Your Windows file associations are set to open .py files in a text editor. You have to change those to use the python.exe interpreter, or you can prefix all your commands with python, like this:

python django-admin.py startproject testprj

If you want to change your file associations, and you are running Vista or Windows 7, you can change them in 'Control Panel'->'Default Programs'->'Associate a file type or protocol with a program'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜