Live data from Hacker News

Python GUIs

pythonguis.com

81–90 of 98 posts

Re: Python GUIs

#81
post #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.

> Good and approachable docs as well.

For me the docs were barely enough to get started, and completely left out some of the features I'm using (such as the `get_line_prefix` callback); it took me a lot of messing around to figure out how to do what I wanted.

But it was probably worth it, I'd say.

Re: Python GUIs

#82

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"…

I'm sure there is a way to fix it on Linux but an interim solution would be to use the windows executable with wine.

Re: Python GUIs

#83
Shameless plug for my own python GUI toolkit: guietta! http://guietta.readthedocs.io/en/latest/

It is built on top of PyQt5. But be very 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.

Re: Python GUIs

#84

Earlier quoted context omitted.

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.

The problem is when you want to create a tool for internal company usage.

There is no problem with that.

Re: Python GUIs

#85
post #18
post #14

Earlier quoted context omitted.

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 bundle…

Check out (my) https://build-system.fman.io.

Re: Python GUIs

#86

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'm working on a project and have been thinking along the same lines. Are there any modern cross-platform tools any language that are good for building like the good old days?

Re: Python GUIs

#87

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 a simple tool to merge pdfs into one - https://github.com/spapas/pomo ; a simple pomodoro t…

The 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

[2] https://tkdocs.com/shipman/universal.html

Re: Python GUIs

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

[1] https://kivy.org/

Re: Python GUIs

#89

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'm working on a project and have been thinking along the same lines. Are there any modern cross-platform tools any language that are good for building like the good old days?

Lazarus with Free Pascal is the only one I know of. The designer component works just like VB/WinForms but works cross platform.

Re: Python GUIs

#90
post #73

Earlier quoted context omitted.

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.

Visual Basic had control styling and the ability to even create custom components as well. For example, I created a textbox control with built-in validation logic in a matter of minutes and was able to drag/drop the control like any other native control onto forms.

I never cared much for VB as a language - but the IDE around it and the ability to very quickly create complex GUI applications was phenomenal.

Post reply on HN