-
Add a shebang line to the top of the script:
#!/usr/bin/env python -
Mark the script as executable:
chmod +x myscript.py -
Add the dir containing it to your
PATHvariable. (If you want it to stick, you’ll have to do this in.bashrcor.bash_profilein your home dir.)export PATH=/path/to/script:$PATH