Make Python script globally executable

前端 未结 2 535
独厮守ぢ
独厮守ぢ 2020-12-17 03:15

Let\'s say I\'ve got this one-line Python module called say_hello.py.

print \'Hello World\'

How can I make the script executab

2条回答
  •  囚心锁ツ
    2020-12-17 03:35

    General *nix answer

    First line of script should look something like:

    #!/usr/bin/python
    

    although the exact path may be different on your system. Then, make the script executable and put it somewhere in your PATH.

提交回复
热议问题