How to run Python script on terminal?

前端 未结 7 672
醉话见心
醉话见心 2020-11-28 08:19

I want to run a Python script in Terminal, but I don\'t know how? I already have a saved file called gameover.py in the directory \"/User/luca/Documents/python\".

7条回答
  •  失恋的感觉
    2020-11-28 09:03

    If you are working with Ubuntu, sometimes you need to run as sudo:

    For Python2:

    sudo python gameover.py
    

    For Python3:

    sudo python3 gameover.py
    

提交回复
热议问题