Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

sh-bang - executable on Linux/Apple

#!/usr/bin/env python

print("Hello World")
  • The first line staring with # is needed if you want to have a file that can be executed without explicitly typing in python as well.
  • Make your file executable: chmod u+x hello_ex.py
  • Run like: ./hello_ex.py
  • In order to run it as hello_ex.py in needs to be located in one of the directories listed in the PATH environment variable.