How to Build User Interfaces with Python — PyQt Basics

Esteban Thilliez
Tech Tavern
Published in
6 min readAug 25, 2022

--

Example of a user interface in Python
An example of a user interface I built using Python (it’s in french as I am french and built it for me)

Are you tired of all the programs you create running in the console? Try graphical interfaces! It’s very easy to do in Python.

Not a Medium subscriber? Read for free here!

PyQt or Tkinter?

PyQt and Tkinter are the two main libraries you can use to build user interfaces with Python. Neither is better than the other, but depending on what you want to achieve one or the other may be more suitable

Tkinter:

  • Simple and light. This allows you to quickly and easily set up a graphical application.
  • Fewer possibilities than PyQt.
  • GUIs are difficult to customize.
  • Works with events to manage interactions.

PyQt:

  • Complex and heavy. The learning curve isn’t the same as the one of Tkinter but once you master PyQt you can build everything.
  • GUIs are easily customizable using style sheets (CSS).
  • Works with a system of signals and slots which can be a bit confusing for beginners.

It’s good to know both libraries, eventually to know how to use them both, and to decide which one to use depending on the project. Tkinter will be useful for small projects, that…

--

--

Esteban Thilliez
Tech Tavern

I’m Esteban, and I enjoy writing about programming, trading, productivity, knowledge management, books, etc! esteban-thilliez.com / contact@esteban-thilliez.com