Calling a python script from command line without typing “python” first

You can prepend a shebang on the first line of the script:

#!/usr/bin/env python

This will tell your current shell which command to feed the script into.

Leave a Comment