What do I use on linux to make a python program executable

clinton picture clinton · Nov 20, 2008 · Viewed 177k times · Source

I just installed a linux system (Kubuntu) and was wondering if there is a program to make python programs executable for linux.

Answer

Vincent Van Den Berghe picture Vincent Van Den Berghe · Nov 20, 2008

Just put this in the first line of your script :

#!/usr/bin/env python

Make the file executable with

chmod +x myfile.py

Execute with

./myfile.py