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

后端 未结 10 1157
梦谈多话
梦谈多话 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:30

    i find a simple alias in my ~/.bash_profile or ~/.zshrc is the easiest:

    alias myscript="python path/to/my/script.py"

提交回复
热议问题