Python to Executable

petercour

petercour

Posted on July 4, 2019

Python to Executable

You can convert Python to executable programs (exe, elf, dmg). These programs can then be run like any other program on the users computer.

This is great, because you don't want to have to explain "install python, open the command line, type this command", but you share a one click program.

Meet Pyinstaller

To do that, one option is pyinstaller.

pip install pyinstaller

Create your program, then

pyinstaller --onefile hello.py

And your program will be available in the dist directory. You'll get the distributable program for the operating system you are currently using.

On windows you'll get an exe, on mac a dmg and on linux an elf file. In the case of hello world you still need to run it from the command line ;)

Learn Python?

💖 💪 🙅 🚩
petercour
petercour

Posted on July 4, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related