DEV Community


Posted on

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

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?

Top comments (0)