https://github.com/tufayellus/convert-python-project-to-executable
This is a template repository code for converting python script to windows executable using cx_freeze library
https://github.com/tufayellus/convert-python-project-to-executable
cx-freeze executable-file python-to-exe python3
Last synced: 11 months ago
JSON representation
This is a template repository code for converting python script to windows executable using cx_freeze library
- Host: GitHub
- URL: https://github.com/tufayellus/convert-python-project-to-executable
- Owner: TufayelLUS
- Created: 2024-03-06T16:39:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-13T09:46:48.000Z (about 1 year ago)
- Last Synced: 2025-01-23T23:44:41.973Z (about 1 year ago)
- Topics: cx-freeze, executable-file, python-to-exe, python3
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Convert Python Project To Executable using cx_freeze
This is a template repository code for converting Python script to Windows executable using the cx_freeze library
# Command to install the library
pip install cx_Freeze
# Instructions
First, place the setup.py file in the same folder where your main Python file is. After that, Place the name of the Python file under the "executables" variable and include any additional files under the "options" variable. Then, set the process's name, add a description, and save the changes.
Now, open the terminal in the folder and run this command
python setup.py build
This will compile the program under the "build" folder.
# How to add a program icon
Change the executables line to this:
Note: If you want to enable the debug console, set base="Console"
executables = [Executable("python_file_name.py", base=base, icon="favicon.ico")]
After that, add the same "favicon.ico" in the same line as "include_files" so that it is like
"include_files": ["favicon.ico"],
Make sure to keep the icon file within the same folder too. Then run the build command, and the program will include the program icon.