zeeshaan786
Published in

zeeshaan786

Converting .py script to .exe Format

You have to make a python application and need to share everyone and use it in one click runnable in this you will get how to do it.

PY to EXE
Py to exe format

There are just simple steps for conversion, let start doing it !!!

Firstly there is an installation of the Python module :

pip install pyinstaller

Now you are thinking, What is PyInstaller ?

PyInstaller bundles a Python application and all its dependencies into a single package. The user can run the packaged app without installing a Python interpreter or any modules.

After the download of the module take any python file/script to convert it into an executable format.

Now, We have to go in the path where a module is installed like (this is my path where module is stored) :

C:\Users\dell\AppData\Roaming\Python\Python37\Scripts
Path where Pyinstaller is stored
Path where Pyinstaller is stored

copy the path in cmd then fire command in cmd :

pyinstaller --onefile
Commands
Commands

After that paste your python file path :

pyinstaller --onefile <here the path of your .py file which you want to convert>
Attach Path of code where it is stored(calc.py is my code)
Attach Path of code where it is stored(calc.py is my code)

After this, you have to press enter :

Pyinstaller convert it into exe
Pyinstaller convert it into exe

And your Python executable file will be in your given folder like this

Exe file in code folder
Exe file in code folder

Under _pycache_ you will get your exe ready !

Exe is ready !!
Exe is ready !!

This is the one method of converting .py to .exe, if you want more methods connect with me in GITHUB or INSTAGRAM.

So, now you have done with your conversion to executable, hope you enjoyed it 💖.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store