Python programming blog

Wednesday, March 24, 2021

How to convert python file in to .exe file


Hello, python programmers, This is AKblogs, In this blog, we're going to learn about how to convert a python file into a stand-alone exe file. For conversion, you have to install a library in python. That is called a pyinstaller.


For installing this package you need to open your command prompt and install the package by using the following command

Command: pip install pyinstaller



after installing this package. You need to go to the python file that you want to convert into an exe file.

On that path, you need to open the windows PowerShell prompt. For opening the windows Powershell prompt you've to press hold shift + right-click.




Now you need to type some command. For converting the python file into an exe file.

Command: pyinstaller --onefile -w 'filename.py'


After typing that comment you need to hit the enter button to start the converting process of the
python file to an executable file.


That's all about the converting process, Now you need to go to your python file path, Here you can see the dist folder. Now open the folder and inside this folder, you can see the executable python file. 




You can easily run that file. And you can use that executable file as a stand-alone application.



Thanks for reading the blog💗


No comments:

Post a Comment