Live data from Hacker News

Python GUIs

pythonguis.com

71–80 of 98 posts

Re: Python GUIs

#71
post #52

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. A few days ago I tried getting a simple PyQtWebengine example working using pyqt6 and failed miserably. It was a frustrating experience for sure

The "good old days" is now: Electron makes it easy to make a UI as expressive as you want - responsive, with beautiful animations, with whatever UI elements you'd like - and you don't have to learn anything new - just HTML, CSS, & JS (which all web devs know enough of to get by).

> The "good old days" is now: Electron

This has got to be one of the funniest opening lines, especially in response to visual basic.

I would begrudgingly accept electron if it had the same "open program, click button , draw a button, double click button, write code" experience that VB had

Re: Python GUIs

#73
post #65

Earlier quoted context omitted.

HTML everywhere killed professional-looking GUI’s. Web devs generally are clueless about application GUI design and usability. It’s sad.

Web devs: they’re all clueless, they’re all lesser, but for the life of me I just can’t seem to make the UI I want and by gum it’s all their fault.

I think the problem is that devs believe they need to create a unique snowflake app every time, each with it's own special sauce.

Visual basic was different because there was only one way to create a button, so no way to over engineer a new button component. All apps looked the same and nobody cared.

Re: Python GUIs

#74
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.

I have used React/Preact/React Native/Flutter to build complex UIs. I thought it would be great to use something like this to render TUI and get rid of some of the app complexity for “simpler” one-user apps. I have used it and it is a nightmare when your app gets just slightly complex. Instead of making simple components I ended up traversing the internals of the library. Impressed by some people getting things done with it though.

- CSS, why?! It does not really work like CSS when it comes to positioning things, overlapping and so on. Compared to previous versions where these properties were in a dict or sent in to the component, they are now in either big string blocks or in separate files, removing syntax highlighting and/or locality.

- Cannot easily use debugging such as PDB because it hijacks Traceback and uses async. Maybe fine if you rely on other debugging tools.

- It lacks simple off-the-shelf components such as menu bars, so I built my own, but run into annoying artifacts as mentioned before.

Rich, the underlying rendering library is good, and simple enough. I ditched Textual for prompt_toolkit, and can still use Rich to render things in pt.

Re: Python GUIs

#75
post #10
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!

Well I haven't seen anyone mention Flet, which is pleasant (if maybe not all that complete) if you have Dart/Flutter experience, so increment your counter at least one. :-) https://flet.dev/

was about to mention this, I plan to also try a small project in flet to see how it works. I have done flutter/dart before, but was not so enthused about the dart experience.

Re: Python GUIs

#76

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. - NiceGUI https://nicegui.io/#features - 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 contribut…

if i was to make a text adventure in a GUI which would be the best one, would you say?

Re: Python GUIs

#77

Nobody has recommended prompt_toolkit (TUI only) yet, so here I go: https://python-prompt-toolkit.readthedocs.io/en/master/ 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. It's quite imperative-feeling though. Have to keep references to individual widgets if you want to do anything wi…

+1 for prompt_toolkit. Good and approachable docs as well.

Re: Python GUIs

#78
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 barely usable.... then I had to change a list to a drop-down (I think), and it broke everything.

I threw all of that time away, and had it all working in Lazarus/Free Pascal in less than 2 weeks.

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.

---

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.

Re: Python GUIs

#79

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.

Also had this problem, tried to create exe packages on windows and had endless trouble (although windows apps aren't my expertise). The real killer in the end for me was some windows security feature that would start killing the process, not immediately, but after a couple of startups. It was an internal tool so in the end I used an executable batch script to start the program, that seemed to bypass the problem, but when it came time to add features and make things available for a wider audience I just abandoned the windows gui and moved to a web app.

Re: Python GUIs

#80

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. 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 have recently tried JavaFX again, and while it definitely involves some getting used to, it has SceneBuilder as a drag’n’drop GUI editor, and that is hard to beat. Plus it will run on every platform and you can choose from plenty languages.

It is a niche (let’s be honest, desktop development is also one), but it has a surprising amount of libraries available as well.

Post reply on HN