How do I install a script to run anywhere from the command line?

后端 未结 10 1161
梦谈多话
梦谈多话 2020-12-04 10:14

If I have a basic Python script, with it\'s hashbang and what-not in place, so that from the terminal on Linux I can run

/path/to/file/MyScript [args]
         


        
10条回答
  •  难免孤独
    2020-12-04 10:52

    Just create symbolic link to your script in /usr/local/bin/:

    sudo ln -s /path/to/your/script.py /usr/local/bin/script
    

提交回复
热议问题