Python & Data Science

Python Desktop Gui Frameworks Compared Tkinter Vs

You’ve built a brilliant Python script. It crunches numbers, scrapes websites, or automates a tedious task that used to take your team all afternoon. You’re proud of it. Then you share it with a colleague, and they stare at the blinking cursor in the terminal like it’s a relic from the 1980s. “Where do I click?” they ask.

That sinking feeling is the moment you realize your script needs a graphical user interface. So you type “Python GUI” into a search engine, and suddenly you’re not a confident programmer anymore. You’re a lost tourist in a warzone of conflicting advice. One forum screams that Tkinter is an ugly dinosaur. Another warns that PyQt has licensing traps that will cost you thousands. A third insists that Kivy is the future, but only if you’re building the next Angry Birds. The paralysis is real, and it’s exhausting.

This article is your ceasefire. We’re going to walk through the three main contenders—Tkinter, PyQt/PySide, and Kivy—not to crown a meaningless “best” framework, but to give you a clear, practical lens for deciding which one is right for your specific project. We’ll look at their architectures, their licenses, and the “feel” of the code you’ll be writing, so you can make an informed choice and get back to building.

The Decision Framework: What Actually Matters When Choosing a GUI Toolkit

Before we write a single line of code, we need a mental model for comparing these tools. Think of it like choosing a vehicle. A bicycle, a sedan, and a pickup truck will all get you from point A to point B, but they solve fundamentally different problems. You wouldn’t use a bicycle to move a couch, and you wouldn’t take a pickup truck for a quick spin to the corner store if a bicycle was sitting right there.

We’ll evaluate each GUI framework on four axes that actually matter for real-world projects:

  1. Can I legally ship this? (Licensing): This is the hardest part for newcomers. “Free” to download and use doesn’t always mean “free to package into a commercial product you sell for money.” We’ll translate the legalese into plain English.
  2. Where will my app run? (Platforms): Does your app need to live only on Windows, macOS, and Linux desktops? Or does it need to run on iPhones and Android tablets too? This single question can eliminate options immediately.
  3. Will it look “right” to users? (Native Look-and-Feel): When a Mac user opens your app, do they see familiar aqua buttons and smooth font rendering, or does it look like a Windows 95 program that got lost? A non-native look can erode user trust, but sometimes it doesn’t matter at all.
  4. How fast can I build it? (Development Speed and Learning Curve): How much boilerplate code do you have to write just to get a button on the screen? Is there a drag-and-drop designer, or are you hand-coding pixel positions?

With these axes in mind, our vehicle analogy snaps into focus. Tkinter is the bicycle in your garage. It’s simple, it’s always there, and it’s perfect for a short trip. It won’t win a beauty contest, but it requires zero paperwork to own. PyQt/PySide is the sedan. It’s comfortable, it looks professional, and it fits right in on any paved road. But you need to check the registration (license) carefully before you can use it for a ride-sharing business. Kivy is the pickup truck. It’s rugged, it can go off-road to places like iOS and Android where sedans fear to tread, but it doesn’t drive or look like a normal car, and that can feel weird on a smooth city street. Let’s meet them one by one.

Tkinter: The Bicycle in Your Garage

Tkinter is the framework you already have. When you installed Python, Tkinter almost certainly came along for the ride. This is its superpower: zero installation, zero dependencies, and a guarantee that your script will run on basically any computer with Python on it.

But what’s actually going on under the hood? In plain English, your Python code doesn’t draw the buttons directly. It talks to a little-known companion called Tcl (pronounced “tickle”), which is a scripting language that has its own built-in GUI toolkit called Tk. Python sends commands like “create a button” to a Tcl interpreter, and Tcl/Tk does the actual work of drawing pixels on the screen. This isn’t just trivia—it explains everything about why Tkinter apps look the way they do. Tk draws its own widgets with its own theming engine to make them look consistent across different operating systems. It doesn’t ask Windows for a Windows button, so you don’t get a native Windows button. You get a Tk button that looks the same on Windows, macOS, and Linux.

Let’s see the architecture in action. Here’s the “Hello World” of GUIs—a window with a button that prints a message to the console.

# Tkinter is part of Python's standard library, so we just import it.
import tkinter as tk

# 1. Create the main window. This is the container for everything.
#    It's like the frame of a house before you put up the walls.
root = tk.Tk()
root.title("Tkinter Hello")  # The text in the title bar.
root.geometry("300x200")     # Width x Height in pixels.

# 2. Define what happens when the button is clicked.
#    This is a plain Python function.
def say_hello():
    print("Hello from Tkinter!")

# 3. Create a button widget. We tell it:
#    - Who its parent is (the root window)
#    - What text to display
#    - What function to call when clicked (the 'command')
hello_button = tk.Button(root, text="Click Me", command=say_hello)

# 4. Place the button in the window. 'pack' is the simplest layout manager;
#    it just stacks widgets vertically, centered by default.
hello_button.pack(pady=20)  # 'pady' adds 20 pixels of vertical padding.

# 5. Start the event loop. This is an infinite loop that waits for
#    user interactions (clicks, keypresses) and calls the right functions.
#    It keeps the window alive until you close it.
root.mainloop()

Every line maps to a concrete action. You create a window, you create a button, you tell the button what to do, you place it in the window, and you start the engine. This “import, create, pack, loop” pattern is the heartbeat of every Tkinter application you’ll ever write.

Now, let’s address the elephant in the room. Run this code, and you’ll see a window that looks… old. The button has a slightly chunky, 1990s aesthetic. This is by design. Tk’s cross-platform consistency comes at the cost of visual modernity. But here’s the catch: you can partially modernize the look using ttk (themed Tkinter) widgets. Swap tk.Button for ttk.Button, and you get a slightly more polished, OS-aware appearance. It won’t fool anyone into thinking it’s a native Mac app, but it’s often good enough for internal tools where function matters more than fashion.

This is the hardest part of Tkinter: the layout managers. You used pack() above, which is simple but can feel like stacking blocks in a dark room. There’s also grid(), which lets you place widgets in rows and columns like a spreadsheet, and place(), which lets you use exact x/y coordinates. The philosophy here is declarative geometry—you describe the relative relationships between widgets (“this button is below that label”), and Tkinter figures out the pixel math. It’s not a drag-and-drop editor, and the learning curve can feel steep until you internalize that you’re not a graphic designer pushing pixels; you’re a writer describing a layout.

PyQt and PySide: The Professional Sedan — Same Engine, Different Keys

If Tkinter is a bicycle, Qt is a luxury sedan factory. It’s a massive, professional-grade C++ toolkit used by companies like Adobe and Autodesk to build complex desktop applications. PyQt and PySide are two different sets of Python bindings that let you drive this C++ engine using Python code. Think of them as the same car with two different key fobs.

The sibling relationship is the first source of confusion. PyQt is maintained by a British company called Riverbank Computing. PySide (specifically PySide6, which tracks Qt version 6) is maintained by The Qt Company itself. They both wrap the same underlying Qt libraries, so the Python code you write looks nearly identical. You’ll import PyQt6 or PySide6, but you’ll call the same classes: QApplication, QWidget, QPushButton. The structural difference is almost zero. The legal difference, however, is worlds apart, and we’ll get to that shortly.

Let’s build the same “Hello” window in PySide6 to see the structural parallels and the key new concept: signals and slots.

# PySide6 is not in the standard library; install it with: pip install pyside6
import sys
from PySide6.QtWidgets import QApplication, QWidget, QPushButton

# 1. Create the application object. This is the engine that manages
#    the event loop and global settings. You need exactly one per app.
app = QApplication(sys.argv)

# 2. Create the main window. In Qt, a window is just a QWidget
#    without a parent.
window = QWidget()
window.setWindowTitle("PySide6 Hello")
window.resize(300, 200)  # Width x Height in pixels.

# 3. Define what happens when the button is clicked.
def say_hello():
    print("Hello from PySide6!")

# 4. Create a button. We tell it who its parent is (the window).
button = QPushButton("Click Me", window)
#    Move the button to a specific position. Qt uses a coordinate
#    system with (0,0) at the top-left corner of the window.
button.move(100, 80)

# 5. Connect the button's 'clicked' signal to our 'say_hello' slot.
#    This is Qt's famous signal-slot mechanism.
button.clicked.connect(say_hello)

# 6. Show the window.
window.show()

# 7. Start the event loop. This is the same concept as Tkinter's mainloop().
#    The underscore in 'exec_' is a Python convention because 'exec' is a
#    reserved keyword. In PySide6, you can also use 'exec()'.
app.exec()

The structure is a close cousin to Tkinter: create an app, create a window, create a button, show the window, start the loop. But the button.clicked.connect(say_hello) line introduces signals and slots. In plain English, this is just a more flexible version of Tkinter’s command= parameter. A signal is an event that a widget can emit (“I’ve been clicked!”). A slot is a function that responds to that signal. You can connect one signal to many slots, or one slot to many signals. It’s a powerful, decoupled way to manage interaction, and it’s the backbone of every Qt application.

Now, here’s the single most anxiety-inducing question in the Python GUI world: “Can I use this in a commercial app without paying thousands of dollars?” Let’s walk through the practical scenarios.

PyQt is available under two licenses. The first is the GNU General Public License (GPL) v3. In plain English, this means: “You can use PyQt for free, but if you distribute your application to others, you must also distribute your application’s source code under a GPL-compatible license.” For an internal tool used only by your team, this is perfectly fine. For a commercial product you plan to sell, it’s a non-starter unless you’re willing to open-source your entire codebase. The second option is a commercial license from Riverbank Computing, which lifts the GPL restriction but costs money.

PySide, on the other hand, is available under the GNU Lesser General Public License (LGPL) v3. This is the sweet spot for commercial desktop apps. In plain English, LGPL says: “You can use PySide in your closed-source, commercial application for free, as long as you dynamically link to the PySide library (which Python does by default) and you don’t modify the PySide library itself.” You can ship your app, charge money for it, and keep your source code private, all without paying a cent for the GUI framework.

There’s one more game-changer for development speed: Qt Designer. This is a drag-and-drop UI builder that ships with Qt. You can visually assemble your windows, save them as .ui files, and load them directly into your Python code. Instead of hand-coding button.move(100, 80) and squinting at pixel coordinates, you just drag the button where you want it. For complex layouts with dozens of widgets, this alone can make PySide the pragmatic choice over Tkinter.

Kivy: The Pickup Truck Built for Touchscreens

Kivy takes a radically different approach. It doesn’t try to look native. It doesn’t even ask the operating system for a button. Instead, Kivy draws everything itself using OpenGL, the same graphics technology that powers video games. This architectural choice is the key to understanding everything about Kivy—its strengths, its weaknesses, and why it feels like a different species from Tkinter and Qt.

Because Kivy is its own rendering engine, a Kivy button looks exactly the same on Windows, macOS, Linux, iOS, and Android. It’s a pixel-perfect, custom-drawn rectangle with Kivy’s own font rendering and animation system. This is why Kivy apps don’t look native anywhere—but it’s also why they can run everywhere from a single codebase. You’re not relying on any OS-specific GUI toolkit, so nothing stops you from deploying to an iPhone or an Android tablet.

Kivy also introduces a declarative language called KV for describing your user interface. The idea is to separate the logic (Python) from the layout (KV), making your code cleaner and letting designers tweak the UI without touching the Python backend.

Let’s build our “Hello” button in Kivy. This requires two files: a Python file and a KV file.

First, the KV file. By default, Kivy looks for a .kv file with the same name as your main app class (minus the “App” suffix). If your app class is HelloApp, Kivy looks for hello.kv.

# hello.kv
# This is the KV language. It's a declarative way to describe widget trees.
# The syntax is indentation-sensitive, like Python itself.

# The root widget is a BoxLayout. It arranges its children in a row or column.
# 'orientation: vertical' stacks them top-to-bottom.
BoxLayout:
    orientation: 'vertical'
    padding: 20
    spacing: 10

    # A Label widget to display text.
    Label:
        text: 'Welcome to Kivy'
        font_size: '24sp'  # 'sp' is a scalable pixel unit, good for different screens.

    # A Button widget.
    Button:
        text: 'Click Me'
        font_size: '20sp'
        # 'on_press' is an event. We connect it to a function in our Python code.
        # 'app' is a keyword that refers to the running App instance.
        on_press: app.say_hello()

Now, the Python file that runs the show.

# hello_app.py
# Kivy is not in the standard library; install it with: pip install kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout

# 1. Define the root widget. This class inherits from BoxLayout,
#    which matches the root widget in our hello.kv file.
class HelloRoot(BoxLayout):
    pass  # We don't need any custom logic in the root widget itself.

# 2. Define the main application class.
class HelloApp(App):
    # This method is called when the app is built. It returns the root widget.
    def build(self):
        return HelloRoot()

    # 3. Define the function that our KV file calls.
    def say_hello(self):
        print("Hello from Kivy!")

# 4. This is the standard Python entry point.
if __name__ == '__main__':
    HelloApp().run()  # Create an instance of the app and start the Kivy event loop.

The KV syntax isn’t magic—it’s a domain-specific language for describing widget trees. You define a BoxLayout, put a Label and a Button inside it, and connect the button’s on_press event to a method on the app object. The Python code is blissfully clean; it just defines the logic and lets the KV file handle the visual arrangement.

This is the hardest part of Kivy: the layout system. Kivy is designed for screens that change size and orientation—think phones rotating from portrait to landscape. Instead of fixed pixel coordinates, you use size_hint (a proportion of the available space) and pos_hint (a relative position). It’s a fluid, percentage-based system that’s incredibly powerful for responsive mobile interfaces but can feel alien if you’re used to Tkinter’s grid or Qt’s designer.

The killer feature is undeniable: one Python codebase that runs on Windows, macOS, Linux, iOS, and Android. This is the reason you’d choose Kivy over the other two. If your app needs to live on phones and tablets, Tkinter is a non-starter (it’s desktop-only), and PyQt/PySide are essentially non-starters for mobile (PyQt6 dropped Android/iOS support, and PySide6 never had it). Kivy owns the mobile cross-platform niche.

But let’s be honest about the trade-off. On a desktop, a Kivy app feels “different.” The custom-drawn widgets don’t match OS conventions for spacing, font rendering, or interaction patterns. A Kivy button doesn’t feel like a Mac button. It feels like a Kivy button. For a game or a custom interactive kiosk, that’s a feature. For a business productivity app where users expect native file dialogs and standard keyboard shortcuts, it’s a significant drawback.

Head-to-Head: The Comparison Table That Actually Helps

We’ve met each framework individually. Now let’s put them side-by-side and focus on the decisions you actually face. This table isn’t a feature checklist trivia contest; it’s a decision-making tool built on the four axes from Section 2.

FeatureTkinterPyQt / PySideKivy
LicensePart of Python’s license (very permissive). You can do anything.PyQt: GPL v3 or paid commercial. PySide: LGPL v3.MIT (very permissive). You can do anything.
What License Means for Commercial UseShip closed-source apps freely. No strings attached.PyQt: You must open-source your app (GPL) or buy a commercial license. PySide: You can ship a closed-source app freely, as long as you don’t modify the PySide library itself.Ship closed-source apps freely. No strings attached.
Desktop PlatformsWindows, macOS, LinuxWindows, macOS, LinuxWindows, macOS, Linux
Mobile PlatformsNonePyQt6: None. PySide6: None. (Older PyQt5 had limited support, now deprecated).iOS and Android (this is Kivy’s superpower).
Native Look-and-FeelLow. Uses Tk’s own theming engine. Looks dated but consistent.High. Uses native OS widgets. A Mac app looks like a Mac app.None. Custom-drawn with OpenGL. Looks the same everywhere.
Learning Curve (1-10)3. Simple API, but layout managers require a mental shift.7. Massive, powerful API. Qt Designer helps, but the sheer scope is daunting.6. KV language is elegant, but the responsive layout system is a new paradigm.
Best For…Internal tools, simple utilities, learning GUI programming, anything where “it just needs to work” on any Python machine.Professional desktop applications you plan to sell, complex data-driven interfaces, anything where a polished, native look is required.Touch-screen applications, mobile apps, games, custom interactive kiosks, any project that must run on phones and desktops from one codebase.

Here are the non-obvious insights from this table. Tkinter’s license is the most permissive of all—it’s just Python’s license—but its visual quality is the lowest. If your users are your colleagues in the next cubicle, that’s a trade-off worth making every time. PySide’s LGPL is the pragmatic sweet spot for commercial desktop apps: professional-grade, native-looking, and free to use in a product you sell. Kivy’s MIT license is the most permissive for mobile apps, and it’s the only viable option on this list if you need to hit iOS and Android.

So, which one is “best”? There is no best. There’s only the right tool for your specific project. A data-entry form for internal use? Tkinter is the no-brainer. A professional desktop application you plan to sell? PySide is your workhorse. An app that needs to run on phones? Kivy is your only real choice from this trio.

The Hardest Part: Licensing Traps and How to Avoid Them

Licensing is the part of GUI framework selection that most tutorials skip, and it’s the part that can cost you real money or legal headaches down the road. Let’s walk through three realistic scenarios and see exactly which framework and license you’d need, with zero legalese.

Scenario 1: “I’m building a tool for my team at work.”

You’re automating a report-generation task. The app will live on a shared network drive, and only your five colleagues in the finance department will ever use it. It never leaves the building.

The play: Use Tkinter. It’s already installed on every machine with Python, it has zero licensing concerns whatsoever, and the “dated” look doesn’t matter because the users care about getting their CSV export, not about pixel-perfect button gradients. If you wanted to use PyQt here, its GPL license is also perfectly fine—you’re not distributing the software to the public, so the requirement to provide source code is trivially met within your own company.

Scenario 2: “I’m building a commercial desktop app to sell.”

You’re building a niche project management tool for architects. You plan to sell licenses for $$99/year. Your users will run it on Windows and macOS. Your source code is your competitive advantage, and you cannot open-source it.

The play: PyQt’s GPL license is now a problem. If you distribute your app to customers, the GPL requires you to distribute your application’s complete source code under a GPL-compatible license. You’d be giving away your product’s secret sauce. You have two viable paths. Path one: use PySide under its LGPL license. You can dynamically link to PySide (which is what import PySide6 does) and keep your own code closed-source and proprietary. This is free. Path two: purchase a commercial license for PyQt from Riverbank Computing. This gives you the right to distribute your closed-source app and often comes with professional support. Tkinter is legally safe here, but the non-native look might hurt your credibility with paying customers.

Scenario 3: “I’m building an app that needs to run on phones.”

You’re building a field-inspection app for surveyors. They need to take photos and enter data on their company-issued Android tablets while standing in a muddy field. A desktop app is useless.

The play: Kivy is the clear winner. Its MIT license lets you do whatever you want with your code, closed-source or open. More importantly, it actually runs on Android and iOS. Tkinter is out immediately—it’s desktop-only. PyQt and PySide are also out. PyQt6 dropped mobile support, and PySide6 never had it. If you need mobile, Kivy isn’t just the best option from this list; it’s essentially the only option.

Recap and Decision Guide

You started this article paralyzed by choice. You now have a clear, practical lens for making a confident decision. Let’s recap the key insights:

  • Tkinter is the bicycle in your garage. It’s always available, simple to learn, and perfectly suited for internal tools and learning projects. It looks dated, but its permissive license and zero-dependency nature make it the ultimate “it just works” option.
  • PyQt and PySide are the professional sedan. They offer a massive, powerful toolkit that produces polished, native-looking desktop applications. The sibling rivalry is a licensing story: PySide’s LGPL is the free path for commercial, closed-source apps; PyQt requires a paid license for the same use case. Qt Designer is a massive accelerator for building complex interfaces.
  • Kivy is the pickup truck built for off-road. Its custom OpenGL rendering means it looks non-native everywhere, but it’s the only framework here that can take your Python code to iOS and Android. Its MIT license is as free as it gets. Choose it when mobile reach is a hard requirement, and accept that your desktop app will have a unique, non-native personality.

Here is your prose decision guide:

  • If you’re building an internal tool and just need buttons and text boxes, start with Tkinter.
  • If you’re building a commercial desktop app that needs to look polished, start with PySide.
  • If you need your app to run on phones or tablets, start with Kivy.

In the next article in this series, we’ll stop talking about these frameworks and start building with them. We’ll construct the same small database viewer application in all three—you’ll see exactly how the code differs, where each framework shines, and where the friction points really are.

Check Your Understanding

Here’s a structured self-assessment to solidify your understanding before you move on to your own project.

Remember: List the three GUI frameworks we discussed and name their primary maintainers.

Understand: Explain in your own words why PyQt and PySide have different licenses even though they wrap the same underlying Qt C++ library.

Apply: You’re building a data-entry application for a small business that will be sold commercially. Which framework and license would you choose, and why?

Analyze: A colleague tells you, “Kivy is the best because it runs on mobile.” Under what specific circumstances would you disagree with their recommendation?

Evaluate: Compare the learning curves of Tkinter and PySide. Which one would you recommend to a beginner who needs to ship a commercial desktop app in three months, and what is the key factor in your recommendation?

Create: Sketch the architecture of a cross-platform app that needs to run on both desktop and mobile. Which framework would you use, and what is the most significant trade-off you would have to accept?

Apply What You Learned is for Supporter and Insider subscribers.

Subscribe to unlock the exercises on this post.

See plans
  • Python Engineering Under review

    Python Ides Compared Pycharm Vs Vs Code Vs Jupyter

    Before we dive deep, let’s get our bearings. Think of this table as your at-a-glance map—a one-sentence answer to “what is this thing, fundamentally?” for each tool.

  • Python Engineering Under review

    Reinforcement Learning Algorithms Reference Which

    Before we name a single algorithm, we need to name the axes that separate them. Otherwise, you’re memorizing names without knowing why they differ—like learning the names of every screwdriver without knowing whether your screw is flathead or Phillips. Let’s fix that.

  • Python Engineering Under review

    Experiment Tracking Tools Compared Mlflow Vs W B V

    Think of experiment tracking as a lab notebook that fills itself out automatically. When you were in science class, you had to write down every step of your experiment by hand.

  • Python Engineering Under review

    Common Pandas Errors Reference: SettingWithCopyWarning and Friends, Explained

    You’ve been there. You’re cleaning a dataset, you write what feels like a perfectly reasonable line of pandas code, and suddenly your console lights up with a wall of red text. Your stomach drops.

Looking for something else?

Search every article by title, summary or topic.