DEV Community

Hamza Hesham
Hamza Hesham

Posted on

1 2

How to convert .py file to .exe 2 methods

hello , today i will show you how to convert python file(.py) to an executable file(.exe) .

first method:

first , open your terminal or command line , write this command to install auto-py-to-exe

pip install auto-py-to-exe

second, after installing auto-py-to-exe write this command to open

auto-py-to-exe

auto-py-to-exe

after writing this command this window will open :
Alt Text
set the script location then convert.

second method:

we will use py installer
in the command line write:

pip install PyInstaller

After installing pyinstaller write the path of the file.
example

cd Desktop

after going to the path of the file:

pyinstaller name_of_the_file.py
example
pyinstaller pass.py

after the build complete select file called dist:
Alt Text
then select name of the file.exe:
Alt Text

Note: auto-py-to-exe uses pyinstaller:

Alt Text
Don't forget to follow me .
you can support me on buy me a coffee:
Buy Me A Coffee
Twitter : https://twitter.com/Oxy_oxide
buy me a coffee : https://www.buymeacoffee.com/Oxyoxide
thanks for reading .

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay