How to create executable file in Python
Run commands without a hassle
1. Install PyInstaller Globally
pip install pyinstaller2. Test Installation
pyinstaller --versionExample output
6.20.03. Create Simple Scripts
# hello.py
name = input("Enter your name: ")
print(f"Hello {name}")4. Build your first executable
pyinstaller --onefile hello.py5. Understand Generated Files
Pyinstaller creates:
build/
dist/
hello.specdist/ - Final executable
build/ - Temporary build files
.spec - Build configuration
6. Run the executable
MacOS/Linux
./dist/helloWindows
dist\hello.exe7. Most Important PyInstaller Options
—onefile
Bundles everything into one executable.
pyinstaller --onefile app.pyWithout this, PyInstaller creates many files.
—name
Custom executable name.
pyinstaller --onefile --name ebs-install app.pyOutput:
dist/ebs-install


