Live data from Hacker News

Guietta – Python module to create simple GUIs

github.com

41–50 of 166 posts

Re: Guietta – Python module to create simple GUIs

#41
post #28

Earlier quoted context omitted.

AFAIK a library that uses LGPL3 modules without any modification is allowed to be licensed differently, provided that the final product allows the LGPL3 modules to be recompiled and/or swapped for others and that the source for the LGPL3 modules is provided.

Thanks. I'm still confused though. If I create an application using Guietta, do I have to follow MIT or LGPL3 terms?

You can follow whatever terms you desire for your application as long as you fulfill the requirements of the licenses of all modules that you use. In case of MIT, it is attribution; in case of LGPL3, you need to make the source of the LGPL3 module available and you need to make it possible for the user to swap the compiled module you ship for their own version of that module.

Re: Guietta – Python module to create simple GUIs

#42
This is so timely! I am teaching CS to some high-schoolers and they just got introduced to Python, I want to hook them by getting them to make something that they can play around with. Could use this there :D

Somehow, it feels like, CS education is getting both easier as new low friction tools are being made available each day and getting harder because the sheer complexity and number of things to know to really understand anything at all the levels of abstractions is getting more complicated.

Re: Guietta – Python module to create simple GUIs

#43
post #32
post #4

Every time I see something like this I think back to the glorious days of Borland Delphi with it's beautiful drag&drop GUI builder.

Ah I came to comment this. Loved the GUI builder in Delphi, it's where I cut my teeth learning to program as a teenager. Since then, I've seen .NET within Visual Studio almost get to the same quality we had with Delphi in 1995, but still way off. Now that everything's a web app wrapped in something like Electron, it should be so much easier to have tooling like this, but yet we're all still building hugely complicate…

I personally think the real reason those types of tools seem less common and popular today is that people remember for example the reputation that Visual Basic programmers got (by the way, I was one). Basically, any really convenient RAD/GUI tool has an association with beginner programmers or even users. The last thing programmers want to be identified with is a user.

Programming is manipulating cryptic colorful text. That sadly seems to be the definition we are stuck with. You start to get into anything that involves drag & drop, you are inviting other programmers to assume you are not good enough with cryptic text.

Its just a stupid psychological thing. And I think it holds back software engineering.

Re: Guietta – Python module to create simple GUIs

#44
post #5

Earlier quoted context omitted.

You don't even have to go back that far. XAML and C# developed with Visual Studio and Expression Blend is a fantastic experience, it almost makes me wish Silverlight was still around.

It's much heavier than what we had with Delphi/VB, it feels like wading through treacle in comparison.

We still have, Delphi might not be loved by younger generations, but it is still around for those that care.

Same applies to C++ Builder, which MS still hasn't been able to match. C++/CX was the closest we got on VS, but then politics killed it.

Re: Guietta – Python module to create simple GUIs

#46

Nice work. I have one out of curiosity question. In the example, there is the button called 'Calculate' and then action define in "gui.Calculate" block. But what if the name of the button was 'Calculate it'(with the space between words)? The action header would be gui.'Calculate it'?

Hello, Guietta author here. For most widgets, the name is derived from the widget text removing all non-alphanumeric characters. So in your example it would become gui.Calculateit

It is also possible to set a custom name using a tuple syntax (widget, 'name'). Like this: (['Calculate'], 'myname')

Re: Guietta – Python module to create simple GUIs

#47

sweet! will this run on mac? edit: tried: "UnboundLocalError: local variable 'loader' referenced before assignment Fatal Python error: could not initialize part 2 ... 'python script.py' terminated by signal SIGABRT (Abort)" :(

Hello, author here. I have tested Guietta on two different macs (mine and a coworker's) and it worked in both cases. There is no variable called 'loader' in Guietta's source code. Are you trying the example in the github readme, or a custom script? Which MacOS version? If you wrote your own script.py, could you please copy it into a github issue?

Re: Guietta – Python module to create simple GUIs

#48

I love how the imports in https://github.com/alfiopuglisi/guietta/blob/master/guietta/... are ordered from shortest to longest. Makes them look like stairs! Very aesthetically pleasing :). Might take that up in my next project.

Some of Python linters enforce such style. If you enable pylint or black I think they do that by default.

black sorts alphabetically, with standard lib first, then 3rd party imports, and user/local imports last. Blocks are separated by a blank line. `from ..` imports come after `import ..`.

Especially the alphabetic ordering is important in my view. Makes parsing/reading and spotting duplicates much easier. It is also PEP8 style [0].

For all these reasons, I think the pyramid style is awful in comparison.

0: https://www.python.org/dev/peps/pep-0008/#imports

Re: Guietta – Python module to create simple GUIs

#49
post #4

Every time I see something like this I think back to the glorious days of Borland Delphi with it's beautiful drag&drop GUI builder.

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.readthedocs.io/en/latest/intro.html

Re: Guietta – Python module to create simple GUIs

#50

This looks great. I have previously written a small GUI application with Qt where it's just a slider and a text label, and when the value of the slider is changed, a command is ran and the label updated. In quickly hacked together Python/Qt, it's 71 lines. It seems like I can cut that down quite a lot by using this. I will have to test it. Thanks!

If you get around to test it, I would love to hear the results :)
Post reply on HN