Python script executable on Unix

On Unix it works usually in the following way:

As the very first line of your file, using the pathname for where the Python interpreter is installed on your platform.

Put #!/usr/bin/env python in the first line of your .py script.

Add execution permissions to the file (using chmod).

chmod +x < >

Execute the script from command line , eg. by providing ./ when in the same directory.