DEV Community

petercour
petercour

Posted on

3 1

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?

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay