Live data from Hacker News

Guietta – Python module to create simple GUIs

github.com

161–166 of 166 posts

Re: Guietta – Python module to create simple GUIs

#161

Earlier quoted context omitted.

Black doesn't sort imports at all.

And PEP 8 doesn't mention sorting the imports. There are even counterexamples which aren't alphabetically sorted. It does mention grouping though. Since Python imports can have side effects, the order can matter. But to the extent that it doesn't break anything, alphabetically sorted groups seems deterministic and readable. I think this might be the most popular implementation for auto-sorting: https://pypi.org/proje…

isort is the most popular, but this is the best by far:

https://github.com/asottile/reorder_python_imports

Re: Guietta – Python module to create simple GUIs

#162

Earlier quoted context omitted.

Actually I started to develop Guietta exactly because using the QT GUI builder (Qt designer) was often too time consuming for simple applications. Designer works great for GUIs with complex layouts. Having an intermediate XML representation puts a lot of distance between your code and your GUI. Sometimes this is good, other times is not. I rant a bit about this at the start of the introduction: https://guietta.readth…

Delphi wasn't like that. There'a a gap a mile wide between 1) tools like Delphi, VisualBasic (the classic version, not .net), and to some extent, HyperCard 2) GUI builders, which were popularized by Visual C++ #1 doesn't have (visible) layers or abstractions. It's a different way to represent your program. You place a few controls, tie them to actions (code), and that's your system. #2 is like onions, with lots of me…

went through a few bad patches but Latest Version is Very enjoyable to code in, and far superior to Delphi 7. Lazarus does a good job too and GPL

Re: Guietta – Python module to create simple GUIs

#163
post #6

Earlier quoted context omitted.

Lazarus(open source and cross platform) is there, alive and thriving, actively developed and used. https://www.lazarus-ide.org/

Too bad, Pascal is not really popular. If only there were similar thing (cross-platform GUI library) but for Go or Rust languages.

Delphi and Lazarus compile to all the major phone, desktop web, targets but I only use it for desktop GUI projects as its the right tool for the right job.

I am lucky to work for myself and have non-technical clients so dont really have to worry about the latest and greatest just what works well for me :-)

Re: Guietta – Python module to create simple GUIs

#164

Earlier quoted context omitted.

What do you mean by the ecosystem?

The available libraries. For Python/JS, I can find libraries to do basically anything I want, but not so for Lazarus libraries.

Not saying pascal is perfect but I haven't come across any issues with missing libraries.

Re: Guietta – Python module to create simple GUIs

#165
post #102

Earlier quoted context omitted.

Glade was the best. Drag&Drop, creates a language-independent XML file, which your program loads and populates with events. * Don't have to change the program to change the UI * Don't have to change the UI to change the program behaviour * Easy to include in version control It was almost akin to HTML and progressive JS. I wish there was a GUI toolkit where you would specify what kind of interaction you need, and it b…

Perhaps I'm missing something, but why the past tense for "Glade"? I thought that was still a completely viable thing to use these days, but I confess I haven't done any Linux GUI dev in several years.

Hmm, yes, perhaps I was mistaken there.

Re: Guietta – Python module to create simple GUIs

#166
post #158

Earlier quoted context omitted.

Any hints towards what kind of issues those cause? I could see some around relative imports, or something else?

Let's say you write a module httpclient doing this: from ssl import sslsocket import httplib as hlib You can think of the code above as remapping and/or duplicating the whole library it's importing. Python imports involve complex local and global states (I don't pretend to understand most of it). One direct effect on usage is that users of the library can call "httpclient.sslsocket" and "httpclient.hlib" as if they w…

Let me take the opposite standpoint here and play the devil's advocate.

> users of the library can call "httpclient.sslsocket" and "httpclient.hlib" as if they were provided by the library

Well, they obviously shouldn't. And maybe they also shouldn't write Python code to begin with because, clearly, they're not able to adhere to Python conventions. Besides, why do you as the library developer care so much about what the users of the library do? If they don't follow your API specifications (proper API documentation should tell the users what they should and shouldn't do), it's their fault. I mean, people can and will shoot themselves in the foot all the time and in various ways. There's is nothing you can do about it.

> which doesn't always work as expected when paths are hot patched as above.

There is a reason why hot patching (and, by implication, mocking) needs to be done with care and only if you fully understand the consequences.

Regarding issues with mocking specifically, I suppose you're referring to nasty questions like https://stackoverflow.com/questions/14341689/how-to-mock-usi... ? Again, these things need to be done with care. (And of course the code also needs to be written in a testable way – no surprise here – and mocking should be done only if you've exhausted all other options.)

> It's not always clear what was the exact issue, except side effects due to imports.

Like you I am a Pythonista but I have honestly never run into any problems with selective imports (`from X import Y`) or import renaming (`import X as Y`) and much less even know what problems you're talking about. Overall, I find Python's way of importing modules rather straight-forward. (That is, as long as PYTHONPATH and __name__ are set correctly. From my POV, this is the only seriously annoying caveat.)

Anyway, I'm very open to changing my opinion but I'm afraid you'll have to be more specific about the issues you're encountering so often. (If you really did encounter them so often, I would think you would have noticed a pattern by now? No offense.)

Post reply on HN