You wrote an amazing Python application and showed it to your friend. He is impressed and wants to use it on his system. He neither has Python installed on his system and nor he has ever worked on it. You are stuck!!!
Convert Your Python Code into a Windows Application (.exe file)
To convert the Python code into an executable file, we will be using Pyinstaller package. Use the standard ‘pip install’ command to install this package.
#### Install Command
pip install pyinstaller
The Actual Task
Let’s go step by step to convert the Python file to a Windows executable:
Open the command prompt
Change folder location to the location of your Python code
#### Change Folder Location
cd folder_location
Use the following command to convert the Python file into a Windows executable
#### Command for conversion
pyinstaller --onefile filename.py
Replace " filename.py " to your python file name
The above code will create a single executable file with the same functionality as your python code. The executable file will be available in a new folder, dist, which will be available at the same location as your Python script.
#Python #Tip
@Ethiotec
Convert Your Python Code into a Windows Application (.exe file)
To convert the Python code into an executable file, we will be using Pyinstaller package. Use the standard ‘pip install’ command to install this package.
#### Install Command
pip install pyinstaller
The Actual Task
Let’s go step by step to convert the Python file to a Windows executable:
Open the command prompt
Change folder location to the location of your Python code
#### Change Folder Location
cd folder_location
Use the following command to convert the Python file into a Windows executable
#### Command for conversion
pyinstaller --onefile filename.py
Replace " filename.py " to your python file name
The above code will create a single executable file with the same functionality as your python code. The executable file will be available in a new folder, dist, which will be available at the same location as your Python script.
#Python #Tip
@Ethiotec