Tkinter docs?

Chris Angelico rosuav at gmail.com
Wed May 24 02:37:52 EDT 2023


On Wed, 24 May 2023 at 13:11, Rob Cliffe via Python-list
<python-list at python.org> wrote:
>
> I have recently started converting a large project to tkinter, starting
> with zero knowledge of tkinter.  (You are free to think: BAD IDEA. 😁)
> I am well aware that adopting a new tool always involves a learning
> curve, and that one is prone to think that things are more difficult
> than they are/should be, and to belly-ache about it, and that in a year
> from now I'll probably wonder what I'm fussing about.

Yes, I do think this is a bad idea, though not an abysmal one. I would
recommend first playing with tkinter in a dedicated UI-only project
before converting the main project to it. Your code in the scratch
project can be as messy as it likes, and then you learn from it before
tackling the big one :)

But your concerns about tkinter's documentation are, sadly,
well-founded. Since it's this weird system of thin wrappers around
Tcl/Tk, a lot of things are basically just "go read the Tk docs".
There are a few key concepts you'll need to get your head around, and
I can't go into details because I never truly got *my* head around
them... but mostly, the way that variables are used and what happens
when events fire.

Good luck with it. I'll be frank, building a GUI can be pretty hard...
I'm still unsure whether the best way is to use something like
tkinter, or to build a web app, pop up a browser window, and establish
a websocket to communicate between your JavaScript front end and your
Python back end. Yeah, that's how bad GUI building can be sometimes -
it is potentially *easier* to build two halves of your app in two
different languages than to make your GUI work the way you want it.

ChrisA


More information about the Python-list mailing list