How to Build Desktop Apps in Python:
A Beginner’s Complete Guide
What is a Desktop App?
- Text editors (Notepad, Sublime, VS Code)
- Media players (VLC, iTunes)
- System tools (Calculator, Task Manager)
- Productivity apps (Slack, Evernote)
How to Build Video Player App using Python?
🐍 Why Use Python for Desktop Apps?
🛠 Popular Python Frameworks for Desktop Apps
| Framework | Description | Best For |
|---|---|---|
| Tkinter | Built into Python, easy to learn, lightweight. | Beginners, simple apps |
| PyQt / PySide | Feature-rich, professional-looking apps. | Complex apps, industry use |
| Kivy | Touch-friendly, works on desktop + mobile. | Cross-platform, modern UIs |
| WxPython | Native-looking UIs, solid performance. | Apps that must feel “native” |
| Dear PyGui | Newer, GPU-accelerated. | Modern, fast apps |
Step-by-Step: Build Your First Desktop App in Python (Tkinter Counter App)
In this tutorial, we will build a simple Desktop Counter App using Python’s Tkinter library. This small project is perfect for beginners learning GUI development.
🔹 Step 1: Basic Setup
Create a Tkinter window titled Counter App.
import tkinter as tk
root = tk.Tk()
root.title("Counter App")
root.geometry("300x200")
🔹 Step 2: Add State (Counter Variable)
We need a variable that keeps track of the count.
count = 0
🔹 Step 3: Add UI Elements
Add a label to show the number and two buttons to increase/decrease it.
def update_label():
counter_label.config(text=str(count))
def increase():
global count
count += 1
update_label()
def decrease():
global count
count -= 1
update_label()
counter_label = tk.Label(root, text="0", font=("Arial", 24))
counter_label.pack(pady=20)
increase_btn = tk.Button(root, text="Increase", command=increase, width=10)
increase_btn.pack()
decrease_btn = tk.Button(root, text="Decrease", command=decrease, width=10)
decrease_btn.pack(pady=5)
🔹 Step 4: Run the App
root.mainloop()
🎉 Final Code (Copy–Paste Ready)
import tkinter as tk
root = tk.Tk()
root.title("Counter App")
root.geometry("300x200")
count = 0
def update_label():
counter_label.config(text=str(count))
def increase():
global count
count += 1
update_label()
def decrease():
global count
count -= 1
update_label()
counter_label = tk.Label(root, text="0", font=("Arial", 24))
counter_label.pack(pady=20)
increase_btn = tk.Button(root, text="Increase", command=increase, width=10)
increase_btn.pack()
decrease_btn = tk.Button(root, text="Decrease", command=decrease, width=10)
decrease_btn.pack(pady=5)
root.mainloop()
Now your first Python desktop application is ready! Feel free to modify the design, add colors, or create more features.
📦 Packaging Your App
A very common question beginners ask is: “How do I share my Python desktop app with others?”
If you created a GUI app using Tkinter, PyQt, Kivy, or CustomTkinter, you can turn it into an EXE file and share it. The user does not need Python installed.
Here are the most popular tools:
- PyInstaller – Creates .exe for Windows, .app for Mac, .bin for Linux
- cx_Freeze – Another packaging option
- Briefcase (BeeWare) – Build apps for Windows, Mac, Linux, Android, iOS
In this tutorial, we’ll use PyInstaller because it's simple and beginner-friendly.
🔧 Step 1: Install PyInstaller
pip install pyinstaller
Run this in Command Prompt or Terminal.
🔨 Step 2: Convert Your Python File Into an EXE
Suppose your project has a file named:
main.py
Now convert it into an EXE:
pyinstaller --onefile --windowed main.py
--onefile = creates a single EXE file
--windowed = hides the console window (recommended for GUI apps)
After the process finishes, PyInstaller will generate:
build/
dist/
main.spec
Your final EXE file will be inside the dist folder:
dist/main.exe
🎨 Optional: Add an App Icon
Make sure your icon file is named app.ico, then use:
pyinstaller --onefile --windowed --icon=app.ico main.py
📁 Optional: Add Images, Audio, or Other Project Files
If your app uses folders like assets/ or images/, add them with:
pyinstaller --onefile --windowed --add-data "assets/;assets/" main.py
This bundles external files together with your EXE.
📦 Tips for Sharing Your App
- Zip the EXE before uploading or sending
- EXE size may be large because Python gets bundled
- Use --windowed for GUI apps (Tkinter / PyQt)
- Test the EXE on your PC before sharing
👍 Our Final Words
PyInstaller is the easiest way to convert your Python project into a shareable desktop app. If you want, I can also create Blogger-style guides for:
- Reducing EXE size
- Fixing PyInstaller errors
- Creating setup installers (.msi)
- Python GUI tutorials (Tkinter, PyQt, CustomTkinter)
- Converting your Python app to Android
✨ Best Practices for Python Desktop Development
- Design First – Sketch out your app’s layout before coding.
- Use OOP – Organize your UI with classes instead of writing everything globally.
- Handle Errors – Wrap critical functions with try/except to avoid crashes.
- Think About UX – Buttons, labels, and menus should feel intuitive.
- Optimize Packaging – Don’t ship unnecessary files with your app.
💡 Project Ideas to Try
- To-Do List App – Add, edit, and delete tasks.
- Weather App – Fetch live weather data from an API.
- Calculator – A basic calculator with buttons for operations.
- Expense Tracker – Store and display expenses in a simple GUI.
- Quiz App – Show multiple-choice questions with scores.


