Live data from Hacker News

Guietta – Python module to create simple GUIs

github.com

71–80 of 166 posts

Re: Guietta – Python module to create simple GUIs

#71

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…

What is your thoughts/wishes for further development?

In no particular order:

radio buttons still basically unsupported - no way of grouping them.

Add optional astropy units for values, maybe extending the tuple syntax: ('__a__', u.km). More difficult than it seems, because one needs to parse input strings. But very useful in a scientific environment.

'with' syntax still very limited, in particular locals() and globals() refer to the Gui class scope so for example anything imported at the beginning of the script is not available inside the with block.

Unit tests almost completely missing, also I have no idea how to properly test GUI code.

Meta-level: add this list to github :)

Re: Guietta – Python module to create simple GUIs

#72

If you want to present GUIs from shell scripts, I highly recommend zenity and/or yad: https://gitlab.gnome.org/GNOME/zenity https://github.com/v1cont/yad

Would have loved few examples of GUI on the project repo like in the OP repo (or) I didn't see where I should have been looking.

I agree, there should be some screenshots in the READMEs. Here are some example uses of yad with screenshots:

https://sanana.kiev.ua/index.php/yad

Re: Guietta – Python module to create simple GUIs

#73

Great idea! Tkinter always looks a little dated and PyQT is more than my brain wants to deal with when I need a simple GUI.

> Tkinter always looks a little dated

It doesn't have to, it supports theming and there are even themes that use the native GUI.

e.g. https://wiki.tcl-lang.org/page/List+of+ttk+Themes (search for “native”)

Re: Guietta – Python module to create simple GUIs

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

And WinForms/Visual Basic There was just something so natural about the way you could quickly throw together a UI and then hook everything up to it.

Looking for my Visual FoxPro people out there

Re: Guietta – Python module to create simple GUIs

#75

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

As a former high-school student who has done many little projects with tkinter at that time, I would recommend against dumping tkinter altogether for several reasons:

- with higher complexity comes higher versatility. I liked how it enabled me to be creative - there are two well-written reference websites for learning it easily despite complexity (and that's important if you want your students to like/learn to read the docs) - the tkinter being shipped with Python meant quite a lot to me

However, the reason I did that many projects is that part of my class wasn't really into programming, so if you think that learning and using this will be significantly easier than tkinter basics, go with it, but I would recommend leaving tkinter at least as an option for "those who want to know more", i.e. students who are considering studying CS.

Re: Guietta – Python module to create simple GUIs

#76
post #57

Earlier quoted context omitted.

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

It takes many years and many people to build tools of that quality. Practically speaking it is way more easy to learn new language instead. I have no problem using Delphi and Lazarus for desktop applications. Saves me big amount of time.

The language isn't the problem, the ecosystem is :/

Re: Guietta – Python module to create simple GUIs

#77

Based on the very limited documentation it seems to follow a similar approach to PySinpleGUI https://github.com/PySimpleGUI/PySimpleGUI PySimpleGUI is indeed simple and quick, not very elegant but useful for small utilities.

Yes, I was inspired by PySimpleGUI (and say as much in the introduction: https://guietta.readthedocs.io/en/latest/intro.html ). But I felt that PySimpleGUI did not go far enough in making things simple. It also supports multiple backends, so that may be a reason to keep things more structured. Guietta is just a thin wrapper over QT.

Well done. Both Guietta and PySimpleGUI surprised me by implementing an Internal DSL for Python. Both leverage Python's List literals to define a GUI grid layout. PySimpleGUI uses nested Lists to define the grid with a .WidgetType() style method used in each slot.

Guietta starts with a Builder Factory method with List literal varargs (one List arg per grid row). Instead of .WidgetType() wrappers, Guietta infers widget type based on List element type and string formatting rules. The resulting column aligned code has the visual look and feel of a grid/table and makes it very readable. The choice of Qt-only seems reasonable.

There is probably a category of DSLs that try to mimic a grid/table layout rather than a natural language DSL (many Ruby style Internal DSLs). This is definitely the style I use for SQL DDL, using a strict grid-like layout for the column constraints and moving the verbose parts (like CHECK constraints) to the table constraints section at the end.

Re: Guietta – Python module to create simple GUIs

#78
post #57

Earlier quoted context omitted.

It takes many years and many people to build tools of that quality. Practically speaking it is way more easy to learn new language instead. I have no problem using Delphi and Lazarus for desktop applications. Saves me big amount of time.

The language isn't the problem, the ecosystem is :/

What do you mean by the ecosystem?

Re: Guietta – Python module to create simple GUIs

#79
Is including arbitrary Qt widgets doable (whether now or in the future)? A lot of my use cases for PyQt5 revolve around QWebEngineView; would be great to be able to throw that widget into a Guietta layout with the extra buttons and such I'd be using around it.

Re: Guietta – Python module to create simple GUIs

#80

Earlier quoted context omitted.

The language isn't the problem, the ecosystem is :/

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.
Post reply on HN