Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What is the recommended modern way to write GUIs in Python? Assume I'm in Python 3.12 and have a Poetry project as my management solution and that I have general software and GUI experience. What do I use? My application might have lots of streaming data to be plotted, streaming images to be displayed, lots of buttons and other elements. Is it PyQt6 with PyQtGraph? I don't want it to look like a Python app.


Tkinter is fairly basic but feels very native on every platform I’ve tried, and it’s easy to use. There are lots of extensions available too. I just wrote a comment about it:

If you’re interested in Python desktop apps, check out TKinter. I have a piece of boilerplate code I typically start with [0], and within an hour I can have a finished piece of software that runs in the native windows manager on any OS with no libraries or frameworks to manage. It’s not the prettiest code but it’s very easy to write and I love how native it is.

[0]: https://gist.github.com/kylenahas/a07f2ce8ced689975eae56d6ea...


How well does it handle live updating charts?


I have used PySide6: https://pypi.org/project/PySide6/

Looks fine, works fine, API matches the C++ docs... slightly unpythonic at times but at least it's well documented.


What is the sales pitch over PyQt? What's the difference? It seems it's more just direct bindings to Qt?


They seem to be largely compatible in terms of the API, so the main difference is the license I think (PySide is LGPL, while PyQt is GPL).


For native GUI, DearPyGui[0] as modern as you can.

For browser web-based GUI, you can use nicegui[1]

[0] -- https://github.com/hoffstadt/DearPyGui

[1] -- https://github.com/zauberzeug/nicegui


Besides being intermediate mode-only, how does it compare to PyQt? How well does it do for streaming data to charts?


For the charts, they use implot[0], it's written in C++. You can interact with the demo website[1] if you want to get a feel of the real-time plotting.

[0] -- https://github.com/epezent/implot

[1] -- https://traineq.org/implot_demo/src/implot_demo.html


Thank you! I will take a look.


What does “a Python app” even look like?


I wouldn't want it to be clear it was made with Python with some vey Python-y library that makes things look a certain way. I want the app to look modern in a way that it could have been written in C# for all the user knows.


I wrote a Python app with a Tkinter GUI for a customer. You can’t tell it’s written in Python or Tkinter as long as you change the default icon.

I’ve encountered a few vendor apps over the years, like data collector apps, that I noticed were written in Python with Tkinter. The only way I knew was they hadn’t changed the default Tkinter icon.


So you’re saying Python is non-modern? Also - Python has no “native” gui toolkit so it’s impossible for things to look “a certain way” that would betray the underlying language.

I think you really have no idea what you’re talking about.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: