I sometimes miss the good old days of visual basic and delphi when I could create a gui that just worked in seconds, help pages via F1 and quick access to all events possible through simple gui clicks.<p>A few days ago I tried getting a simple PyQtWebengine example working using pyqt6 and failed miserably. It was a frustrating experience for sure
I'm a big fan of using wxPython instead of Qt or the other recommendations in OP.<p><a href="https://www.wxpython.org/" rel="nofollow noreferrer">https://www.wxpython.org/</a><p>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.
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: <a href="https://textual.textualize.io/" rel="nofollow noreferrer">https://textual.textualize.io/</a><p>this is the most modern GUI (in a console or not) framework you'll find for Python right now.
I lost a year of time on a side-project because of WxPython, I built a shim to allow me to make small tweaks without having to regenerate the python code, and it was <i>barely</i> usable.... then I had to change a list to a drop-down (I think), and it broke everything.<p>I threw all of that time away, and had it all working in Lazarus/Free Pascal in less than 2 weeks.<p>Most web based programmers have no clue how badly "modern" tools are compared to the VB6/Delphi era. Everything is worse, except for GIT... GIT is brilliant.<p>---<p>Also, my personal wiki of choice is WikidPad, which is distributed as an executable for windows, and works just fine. I can't move to Linux, because it's distributed as source there, and WxWindows made a breaking change to one of their key parameters to dialog function calls, so none of the dialogs work properly, though it does show text. It's effectively read-only and broken as a result.
For vanilla applications PySimpleGUI is so easy to use: <a href="https://www.pysimplegui.org/en/latest/" rel="nofollow noreferrer">https://www.pysimplegui.org/en/latest/</a><p>Personally, if I'm writing software that needs to talk to a human I'll just build a web interface instead of a GUI.
I love gooey: <a href="https://github.com/chriskiehl/Gooey">https://github.com/chriskiehl/Gooey</a><p>It allows me to quickly slap a GUI on an existing script that accepts command-line-arguments. In the end, I get the best of both world: Discoverability from the GUI, automation through the script, and automatic feature parity between the two.<p>Downside: Control over the GUI layout is basic, and only "standard" GUI features work, but I never felt limited when using it.
I tried to use GTK for a little project at work and I couldn't figure out how to make it look decent.<p>I ended up making a flask app and launching a browser. It seemed to be 100x easier.<p>I would prefer to make native GUI apps but it's just so much more difficult.
It would be nice to have a canonical python GUI framework. Something modern and elegant and flexible. With an intuitive declarative description, quick for simple things but progressivly enhanceable for more complex things. With a friendly license and an active community sharing components, themes or whatever. Reasonanly performant and ideally cross-platform.<p>All the options fall short somehow, but guess what, its not much better in any other language. The GUI problem is not truly solved.
The problem remains delivering the app to the customer in my experience, unless something like flatpak can be used cross platform.<p>Unless picking a solution from the start and testing it throughout, I find that the most challenging.
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).<p>As a showcase I've built two simple utils with python and tk (and pyinstaller):<p>- <a href="https://github.com/spapas/pdfmerger">https://github.com/spapas/pdfmerger</a> a simple tool to merge pdfs into one<p>- <a href="https://github.com/spapas/pomo">https://github.com/spapas/pomo</a> ; a simple pomodoro timer
I used wxPython many, many years ago on a foolish project. I am sure it has matured.<p>But as always, I turn to PEP 20, in particular "There should be one-- and preferably only one --obvious way to do it." Batteries <i>ought</i> 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.<p>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.
My guilty secret is to use Excel for my quick and dirty GUIs. I wrote a library to make that easy if you know C++. <a href="https://github.com/xlladdins/xll">https://github.com/xlladdins/xll</a>.
People already know how to use Excel so I don't have to start from scratch
PyQT's license is not ideal, and that's why Pyside exists.<p><a href="https://www.pythonguis.com/faq/pyqt-vs-pyside/" rel="nofollow noreferrer">https://www.pythonguis.com/faq/pyqt-vs-pyside/</a>
I've been coming in and out of the Python ecosystem for years as it isn't my primary tool but often is a piece of a project or something along those lines. Is it just my limited exposure, or is there a sort of stagnated, low-key 'GUI lib cold-war' going on in the Python space?<p>Many libraries, and framework-type things seem to have come and gone, while none have really 'taken hold', so to say. Is this the case? And, specifically, what is the big hurdle to a widely accepted GUI library in Python?
Nobody has recommended prompt_toolkit (TUI only) yet, so here I go:<p><a href="https://python-prompt-toolkit.readthedocs.io/en/master/" rel="nofollow noreferrer">https://python-prompt-toolkit.readthedocs.io/en/master/</a><p>I'm working on an interface for an LLM (large language model), and prompt_toolkit seems to be the only library with enough text-buffer features for me to implement everything I want.<p>It's quite imperative-feeling though. Have to keep references to individual widgets if you want to do anything with them later.
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.<p>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?
Shameless plug for my own python GUI toolkit: guietta! <a href="http://guietta.readthedocs.io/en/latest/" rel="nofollow noreferrer">http://guietta.readthedocs.io/en/latest/</a><p>It is built on top of PyQt5. But be <i>very</i> careful if you use conda, because conda decided to rename the PyQt5 packages, resulting in near-irrecoverable env crashes if conda and pip are mixed. In that case, make sure to use conda-forge to install.
A interesting option I haven’t seen mentioned here is Beeware, an open-source (MIT) project with this summary:<p>“Write your apps in Python and release them on iOS, Android, Windows, MacOS, Linux, Web, and tvOS using rich, native user interfaces. Multiple apps, one codebase, with a fully native user experience on every platform.”<p>Source: <<a href="https://beeware.org" rel="nofollow noreferrer">https://beeware.org</a>>
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.<p>* Between starting and finishing this comment, someone brought up a third. Now we're up to seven!
I have been looking at Python GUI libraries/frameworks/services over the past > 1 year. I'll cut straight to the chase with my recommendations for what they are worth.<p>- NiceGUI <a href="https://nicegui.io/#features" rel="nofollow noreferrer">https://nicegui.io/#features</a> - my favorite of the bunch, essentially wraps Quasar Vue components with accessible python. Tons of features including SPA, FastAPI under the hood, TailwindCSS. Have used it on a few projects and started contributing recently.<p>- Streamlit <a href="https://streamlit.io/" rel="nofollow noreferrer">https://streamlit.io/</a> - if your goal is to get some python code set up with a GUI and deployed ASAP this is the best option. I have gone from 0 to a full working app in like an hour for some projects. Lots of love for it. A bit limited in terms of full-scale applications and large backend databases but it actually holds up really well.<p>There are a lot of other ones that people regularly recommend.<p>- Gradio <a href="https://gradio.app/" rel="nofollow noreferrer">https://gradio.app/</a> - really popular with huggingface and ml folks. Similar to streamlit in that it sacrifices some level of depth for speed of standing up projects.<p>- Textual <a href="https://www.textualize.io/projects/#textual" rel="nofollow noreferrer">https://www.textualize.io/projects/#textual</a> - Building text-based UIs for the console. Seems to be pretty popular on reddit... Not to be a hater, but I have never seen a good argument for why it's worth dumping a bunch of time into this versus a web-oriented framework. They say "it's useful for products that don't need the internet", "you can use it through ssh", etc... doesn't really fit with my needs, I'll just leave it at that.<p>- Anvil <a href="https://anvil.works/" rel="nofollow noreferrer">https://anvil.works/</a> - a "low code" option for building python GUIs. I am pretty impressed, it has integrated databasing and a lot of plugins. If you are aiming for a scalable application for a large number of users this is probably a good options. My personal gripe with it is the number of mouse clicks it takes to do stuff but that could also be my lack of experience with the tool.<p>- Plotly dash <a href="https://dash.plotly.com/" rel="nofollow noreferrer">https://dash.plotly.com/</a> - not usually thought of as a full GUI library necessarily but they have options for deploying the dashboards to the web - and the overall look and feel is nice. A good option if you have a small notebook with plots that needs wider accessibility.<p>My use cases are typically 10 - 50 users in an enterprise setting, so accessibility/low barrier to entry (pretty much meaning web-based) are concerns of mine. I also lean toward wanting to avoid learning overly-opinionated libraries (I put Qt and tkinter into this category). Why spend 50 hours learning Qt's way of building an app when I could use something like NiceGUI which lets you build a nicer looking app and gets you familiar with web dev concepts in the process. Imo a better use of my time.
Anyone has some experience with Kivy [1]? It seems that it checks off some of my requirements, like cross-platform, supporting touch interfaces, ease of development, allows complex/fancy UIs as well, etc.<p>[1] <a href="https://kivy.org/" rel="nofollow noreferrer">https://kivy.org/</a>