Executing Python Scripts With a Shebang – Real Python
It's only when you provide the absolute path to your Python interpreter using a shebang in your script that the shell will know where to pass that script: $ script.py #!/usr/bin/python3 print ("Hello, World!") $ ./script.py Hello, World! This is very convenient because you can now make runnable Python scripts.