Running Python in PowerShell?

前端 未结 7 1553
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 12:48

I am attempting to learn the very basics of Python using the guide \"Learn Python the hard way\" by Zed A. Shaw. The problem that I am having is that I can run Pyth

相关标签:
7条回答
  • 2020-12-01 13:12

    Using CMD you can run your python scripts as long as the installed python is added to the path with the following line:

    C: \ Python27;
    

    The (27) is example referring to version 2.7, add as per your version.

    Path to system path:

    Control Panel => System and Security => System => Advanced Settings => Advanced => Environment Variables.

    Under "User Variables," append the PATH variable to the path of the Python installation directory (As above).

    Once this is done, you can open a CMD where your scripts are saved, or manually navigate through the CMD.

    To run the script enter:

    C: \ User \ X \ MyScripts> python ScriptName.py
    
    0 讨论(0)
提交回复
热议问题