Python Tutorial: Convert python file (.py) into .exe l Add custom icon (step by step)

Published: 21 July 2024
on channel: Ferds Tech Channel
1,531
12

In this video, I will cover how to convert python file (.py) into .exe.

PyInstaller is a popular tool for converting Python applications into standalone executables,
making it easier to distribute and run your applications on different systems without requiring a Python interpreter.

Procedure:
1. Install PyInstaller:
pip install pyinstaller
2. Create the executable:
Syntax: pyinstaller --onefile --noconsole --icon=myicon.ico app.py
Example: pyinstaller --onefile --noconsole --icon=switch.ico COMMANDS_RUNNER.py

--onefile: Packages everything into a single executable file.
--noconsole: Ensures no console window appears when running the executable (useful for GUI applications).
--icon=myicon.ico: Adds a custom icon to the executable.

3. Locate your executable in the dist directory:
dist/app.exe


Resources:
https://pyinstaller.org/en/stable/
https://www.iconarchive.com/

#python #pythonforbeginners #programming


On this page of the site you can watch the video online Python Tutorial: Convert python file (.py) into .exe l Add custom icon (step by step) with a duration of hours minute second in good quality, which was uploaded by the user Ferds Tech Channel 21 July 2024, share the link with friends and acquaintances, this video has already been watched 1,531 times on youtube and it was liked by 12 viewers. Enjoy your viewing!