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

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.

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

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

Leave a Reply

Your email address will not be published. Required fields are marked *