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
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.
Add as the first line of your script:
#!/usr/bin/env python
or, for a python3 script:
#!/usr/bin/env python3
The shell (actually the kernel) will use the first Python/Python3 interpreter found in your $PATH.