Convert any Python script into a standalone executable (.exe or .app) with full GUI support!
Turn your Python code into distributable applications that run on Windows and macOS without requiring Python to be installed. Perfect for sharing tools, games, and GUI applications with anyone.
- One-Click Conversion - Paste your code, get an executable
- Full GUI Support - tkinter, PyQt5/6, PySide2/6, wxPython, pygame, and more
- Image & Resource Bundling - Include images, data files, and assets
- Auto-Dependency Detection - Automatically finds and installs required packages
- Single File Output - Everything bundled into one portable executable
- Smart Console Detection - Automatically detects if your app needs a console window
- Cross-Platform - Works on Windows and macOS
- No Python Required - Generated executables run standalone
- Python 3.7 or higher
- PyInstaller (auto-installed if not present)
- Download
py_to_exe_packager.py - Run it:
python py_to_exe_packager.py
That's it! PyInstaller will be installed automatically if needed.
python py_to_exe_packager.pyFollow the prompts:
- Enter your application name
- Paste your Python code
- Type
ENDon a new line - Configure options (or use defaults)
- Wait for the build to complete
Your executable is ready!
import tkinter as tk
root = tk.Tk()
root.title("Calculator")
root.geometry("300x400")
display = tk.Entry(root, font=("Arial", 20), justify="right")
display.pack(fill="both", padx=10, pady=10)
# Add calculator buttons here...
root.mainloop()
ENDSettings:
- Show console window? →
n(it's a GUI app!) - Auto-detect dependencies? →
y
Output: Calculator.exe or Calculator.app - ready to distribute!
import tkinter as tk
from PIL import Image, ImageTk
root = tk.Tk()
root.title("Photo Viewer")
img = Image.open("photo.jpg")
photo = ImageTk.PhotoImage(img)
label = tk.Label(root, image=photo)
label.pack()
root.mainloop()
ENDSettings:
- Files:
photo.jpg - The packager will auto-install Pillow!
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
import sys
app = QApplication(sys.argv)
window = QMainWindow()
window.setWindowTitle("My PyQt App")
window.setGeometry(100, 100, 600, 400)
label = QLabel("Hello PyQt5!", window)
label.move(200, 150)
window.show()
sys.exit(app.exec_())
ENDThe packager automatically:
- Detects PyQt5
- Installs it if needed
- Adds hidden imports
- Suggests windowed mode
import pygame
import sys
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("My Game")
clock = pygame.time.Clock()
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill((30, 30, 60))
# Your game logic here...
pygame.display.flip()
clock.tick(60)
pygame.quit()
sys.exit()
END| Framework | Status | Auto-Install |
|---|---|---|
| tkinter | ✅ Built-in | N/A |
| PyQt5 | ✅ Full Support | Yes |
| PyQt6 | ✅ Full Support | Yes |
| PySide2 | ✅ Full Support | Yes |
| PySide6 | ✅ Full Support | Yes |
| wxPython | ✅ Full Support | Yes |
| pygame | ✅ Full Support | Yes |
| Kivy | ✅ Full Support | Yes |
| pyglet | ✅ Full Support | Yes |
from py_to_exe_packager import PyToExecutable
packager = PyToExecutable()
code = """
import tkinter as tk
root = tk.Tk()
root.title("My App")
tk.Label(root, text="Hello World!").pack()
root.mainloop()
"""
packager.create_executable(
code=code,
app_name="MyApp",
console=False, # GUI app, no console
icon_path="icon.ico",
additional_files=[
("data.txt", "."),
("images/logo.png", "images"),
],
auto_detect=True # Auto-install dependencies
)Format Options:
file.txt→ Bundled at rootfile.txt:folder→ Bundled infolder/file.txt->folder→ Alternative syntaximages/→ Bundle entire folder
Accessing Bundled Files in Your Code:
import sys
import os
# Get the correct base path
if getattr(sys, 'frozen', False):
# Running as compiled executable
base_path = sys._MEIPASS
else:
# Running as script
base_path = os.path.dirname(__file__)
# Load your file
file_path = os.path.join(base_path, 'data.txt')
with open(file_path, 'r') as f:
data = f.read()Windows: Use .ico files
macOS: Use .icns files
Icon file path: assets/myapp.ico| Option | Description | Default |
|---|---|---|
| Application Name | Name of the executable | Required |
| Console Window | Show terminal window | Auto-detect |
| Icon Path | Custom icon file | None |
| Output Directory | Where to save executable | Current directory |
| Additional Files | Bundle resources | None |
| Auto-detect | Find dependencies automatically | Yes |
| Hidden Imports | Manual module includes | Auto-detected |
| Packages | Install before building | Auto-detected |
Your generated executable is completely standalone:
✅ No Python installation required
✅ No dependencies to install
✅ Single file to distribute
✅ Works on any compatible OS
Simply share the .exe (Windows) or .app (macOS) file!
The packager should auto-detect modules, but if you get errors:
- Manually specify hidden imports
- Install the package:
pip install package-name - Add to packages list when prompted
- Check if antivirus is blocking it (common with PyInstaller)
- Verify all required files are bundled
- Test with console mode enabled to see errors
Executables include Python and all dependencies:
- Typical size: 10-50 MB
- Use virtual environments for smaller builds
- Consider using
--onedirmode (not single file)
Rename any files in your directory that match Python standard library names:
mv email.py my_email_script.py- Built with PyInstaller
- Supports all major Python GUI frameworks
- Inspired by the need to easily share Python applications