Live data from Hacker News

Python GUIs

pythonguis.com

11–20 of 98 posts

Re: Python GUIs

#11
post #2

for Python GUIs (or "TUIs", or "a screen with colorful buttons and controls I can use with the mouse or keyboard but NOT a "GUI" " if that helps some of the responders to get through the day) I recommend considering a console-based GUI using the excellent Textual: https://textual.textualize.io/ this is the most modern GUI (in a console or not) framework you'll find for Python right now.

Wow, Textual looks amazing. Thanks for the link.

Re: Python GUIs

#12
The problem remains delivering the app to the customer in my experience, unless something like flatpak can be used cross platform.

Unless picking a solution from the start and testing it throughout, I find that the most challenging.

Re: Python GUIs

#13
post #7

The guide lists four different GUI frameworks and the comments (so far!) have listed two more.* None of them really have claim to being the good "default" (except maaaaaaaaybe tkinter) and all of the "GUI-knowledge" is fragmented across them. I like Python but whenever I have to make a GUI, I shy away. * Between starting and finishing this comment, someone brought up a third. Now we're up to seven!

Both PySide and PyQt are Python wrappers for the Qt library (that makes it 2 frameworks). Basic usage is almost the same.

It seems the author push for PyQt a bit, even though PySide has the same basic capabilities with the benefit of LGPL license (PyQt is GPL or Commercial).

Re: Python GUIs

#14

The problem remains delivering the app to the customer in my experience, unless something like flatpak can be used cross platform. Unless picking a solution from the start and testing it throughout, I find that the most challenging.

I have found PyInstaller [1] to work well for packaging everything into a single ZIP file that unzips to a folder with an executable binary and all accompanying files (or even a single EXE file that self-extracts when run, but that increases startup time). It knows how to package PyQt and its associated Qt libraries (or PySide, which I actually prefer) so that they can be shipped with your application.

[1 https://pyinstaller.org/en/stable/

Re: Python GUIs

#15
post #9

I tried to use GTK for a little project at work and I couldn't figure out how to make it look decent. I ended up making a flask app and launching a browser. It seemed to be 100x easier. I would prefer to make native GUI apps but it's just so much more difficult.

I have had the same problem whenever I've tried to use GTK. Qt, which is what the article is mostly based on, has worked much better for me.

Re: Python GUIs

#16

I'm a big fan of using wxPython instead of Qt or the other recommendations in OP. https://www.wxpython.org/ wxWidgets is mostly licensed under an LGPL analog with linking exceptions intended to permit distributing binaries under any license you choose. No part of wxWidgets, including wxPython, has a license more restrictive than the LGPL.

I have tried wxWidgets and wxPython, and while there are many nice features, my issue with it has always been that its behavior is inconsistent across platforms. I have found Qt to be much better at delivering the same experience across platforms. Using PySide 2 with the previous version of Qt (Qt 5 instead of the current Qt 6) avoids any licensing issues since PySide 2 uses the LGPL version of Qt 5.

Re: Python GUIs

#17
I used wxPython many, many years ago on a foolish project. I am sure it has matured.

But as always, I turn to PEP 20, in particular "There should be one-- and preferably only one --obvious way to do it." Batteries ought to be included. I'm hardly a language designer, but more and more I care less about things like syntax and such, and more about having as much as possible already built out, so I can focus on the particulars of a problem, rather than having to endure a "evaluate a bunch of alternatives" phase for each little thing.

It's a tall order, and a growing one, but I think whatever the next big language is, it will have that kind of focus.

Re: Python GUIs

#18
post #14

The problem remains delivering the app to the customer in my experience, unless something like flatpak can be used cross platform. Unless picking a solution from the start and testing it throughout, I find that the most challenging.

I have found PyInstaller [1] to work well for packaging everything into a single ZIP file that unzips to a folder with an executable binary and all accompanying files (or even a single EXE file that self-extracts when run, but that increases startup time). It knows how to package PyQt and its associated Qt libraries (or PySide, which I actually prefer) so that they can be shipped with your application. [1 https://pyi…

Yeah, PyInstaller is the best thing out there if you need to bundle a complex Python app into an executable, with cx_Freeze not far behind.

But it's still considered challenging when you compare with any other compiled language, where you can get an executable out of the box. I ship Python desktop apps at work and it's remarkable how much code we accumulated over the years just to deal with the "interpreter in bundled/exe mode".

Re: Python GUIs

#19
I'll piggyback here for a related question: I need to build some simple UI on top of a few Snowflake tables, to support a small group of users and their quality assurance tasks. Essentially, they verify important metadata and need to fix it in the Snowflake tables when it is incorrect.

Ideally, I can build that with Python. I was thinking of DRF and React (since things like Retool are out of the question) but I'm open to any framework/stack. What is the most simple way to accomplish and maintain this?

Re: Python GUIs

#20

Many of the Python GUIs here are GPLv3, which unfortunately makes them a nonstarter in a lot of projects.

Why should anyone care about that?

If you want to sell something and keep it all to yourself, then go buy something. Qt will happily sell you a quite nice resellable component. If you want to reshare that which you got for free yourself, great, no problem there either.

Say what exactly is the problem that isn't either of those two situations out loud.

Post reply on HN