This repository contains automation scripts for compiling Python scripts into standalone executable applications using PyInstaller.
- Cross-platform support: Includes both
.sh(Bash) and.ps1(PowerShell) scripts. - Architecture Detection (Linux): The Linux script automatically appends the processor architecture (e.g.,
_x86_64or_aarch64) to the output filename for better identification. - Auto GUI Detection: Automatically scans the source code for GUI libraries (like
tkinter,PyQt,customtkinter, etc.) and sets the--noconsoleflag accordingly. - Interactive Selection: Provides a menu to choose which
.pyfile you want to compile. - Clean Workspace: Automatically moves the build results to the root folder and cleans up temporary
build/,dist/, and.specfiles. - Pre-configured imports: Includes support for common libraries like
openpyxl.
- Python 3.x
pyinstallerinstalled (pip install pyinstaller)- (Optional)
whiptailfor the Linux version menu.
Run the build.ps1 script:
./build.ps1Run the build.sh script:
chmod +x build.sh
./build.sh- The script identifies the project folder name.
- Linux only: Detects system architecture using
uname -mand incorporates it into the app name. - It searches for all
.pyfiles in the current directory. - The user selects a file via a CLI menu.
- The script checks if the selected file requires a console or a GUI window.
- PyInstaller is executed with optimized flags.
- The final executable is moved to the root directory for easy access.