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

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


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


If you want to obtain a stand-alone binary application in Python try to use a tool like py2exe or PyInstaller.


You can use PyInstaller. It generates a build dist so you can execute it as a single "binary" file.

http://pythonhosted.org/PyInstaller/#using-pyinstaller

Python 3 has the native option of create a build dist also:

https://docs.python.org/3/distutils/builtdist.html