4 ms·
I think that tkinter is "good enough" for most cases that need a GUI in pythonb these days (for more complex stuff you'd better go with either a web app or a co
by spapas82 3y ago
I think that tkinter is "good enough" for most cases that need a GUI in pythonb these days (for more complex stuff you'd better go with either a web app or a compiled language that creates normal desktop apps).
As a showcase I've built two simple utils with python and tk (and pyinstaller):
- https://github.com/spapas/pdfmerger https://github.com/spapas/pdfmerger a simple tool to merge pdfs into one
- https://github.com/spapas/pomo https://github.com/spapas/pomo ; a simple pomodoro timer
- ptx 3y agoThe pomodoro example seems to be updating the UI from a background thread. The TkDocs tutorial [1] advices against this and suggests posting a custom event to the main thread instead. Using the after or after_idle methods [2] to post a callback to the main thread also works, and seems easier to me since it allows you to pass arguments. In this particular example, where the background thread is just used as a timer, you could remove the threading entirely if you use after to let Tkinter handle the timer. [1] https://tkdocs.com/tutorial/eventloop.html#threads https://tkdocs.com/tutorial/eventloop.html#threads [2] https://tkdocs.com/shipman/universal.html https://tkdocs.com/shipman/universal.html
- spapas82 3y agoThank you for the suggestion I'll update my code to use after instead!