Sitemap

Member-only story

How to setup correctly an application with Python and Tkinter

8 min readAug 18, 2019

--

Press enter or click to view image in full size

I am a command line kind of programmer; GUI tools make me shiver and growl until I can scuttle back to the safety of a terminal. However, from time to time the need arises to create a functional — albeit simple — user interface, be it due to the target system or because the tool needs to be shared with less tech-savvy friends. In those rare cases my go-to choice of tools is usually Python paired with the Tk UI library.

It’s not the best. Before using it I always allocate half an hour to the research of a more reliable, modern tool for the job; unfortunately I have yet to find something that fits my requirements. I’ve tried C with GTK bindings, Javascript desktop apps, Kivy, WxWidgets, Go UI. In a tragic turn of events, even Universal Windows Platform. Flutter desktop is my next hope.

Press enter or click to view image in full size
Lord, forgive my sins.

In the end I always fall back to Tkinter. Not because of some redeeming quality or feature that other frameworks lack; it is essentially a stripped down widget composer, extremely simple and ideally included in every Python installation. My applications are simple synoptics with few text entries, buttons and sliders; demonstrations that need to be built up as quickly…

--

--

Mattia Maldini
Mattia Maldini

Written by Mattia Maldini

Computer Science Master from Alma Mater Studiorum, Bologna; interested in a wide range of topics, from functional programming to embedded systems.