Python script (reindent.py) not working as executable in Windows7 from powershell/cmd

本秂侑毒 提交于 2019-12-12 09:20:12

问题


I want to reindent a big python source file, and using windows 7 64-bit, powershell, and pip. I installed reindent with pip install reindent. I can see reindnet in pip freeze, and I suppose the package should work fine. But, when I do - reindent -n \path\to\file.py, I am always prompted to open a file, and the content of the file is always as follows -

#!c:\python27\python.exe
from reindent import main
main()

I am bit clueless and curious about this behavior. What exactly is happening here? How do I solve this?

I have set System Path variables with following entries-

C:\Python27
C:\Python27\Scripts

Also, I can run python and <python_files>.bat on powershell and cmd.

来源:https://stackoverflow.com/questions/35583682/python-script-reindent-py-not-working-as-executable-in-windows7-from-powershel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!