Live data from Hacker News

PysimpleGUI

github.com

121–130 of 159 posts

Re: PysimpleGUI

#121
post #29

What is the recommended modern way to write GUIs in Python? Assume I'm in Python 3.12 and have a Poetry project as my management solution and that I have general software and GUI experience. What do I use? My application might have lots of streaming data to be plotted, streaming images to be displayed, lots of buttons and other elements. Is it PyQt6 with PyQtGraph? I don't want it to look like a Python app.

For native GUI, DearPyGui[0] as modern as you can.

For browser web-based GUI, you can use nicegui[1]

[0] -- https://github.com/hoffstadt/DearPyGui

[1] -- https://github.com/zauberzeug/nicegui

Re: PysimpleGUI

#122

We had a work requirement to start logging hours in Jira. I hated having the website open, it was slow to find the Jira I was working on, find the link for logging hours and adding a comment. I wanted a desktop app that had a list of issues assigned to me with buttons to add comments and work log hours. I messed with Tkinter but was struggling for awhile just getting it to look…nice. I stumbled on PySimpleGUI and sud…

Do you have the sources for this application available somewhere? I was considering writing something similar just this week. So an already available application where I just point it to the right instance would be amazing

I’ll see if I can publish it. It’s not proprietary but I just have to get the blessings first.

Re: PysimpleGUI

#123
post #14

I'm really, really excited about these GUI frameworks. Native desktop experience is so much better than web-view amalgamations. And kudos to PySimpleGUI for the simplified event loop, and multi-backend approach, that is genuinely new. I do wonder why don't we see more "automatic" GUIs: given some data structures and functions, make a passable interface to interact with them. Use heuristics to pick when a panel should…

I've played with this a bit over the years, starting with my automatic form generator for the web back in 2011 based on function arguments (coupled with an automatic data to html thing to see the function output), and more recently some similar stuff for my gui toolkit too (using the D programming language).

For example, you can write:

``` import arsd.minigui;

void main() { // need to define the data you want in a struct, // it requires a struct even if you only want one item struct Data { string code; }

// then do the dialog function with the struct and it // auto-creates a dialog for all the parts of the struct // and calls the function you provide when the user hits OK dialog((Data received) { // you got the number here

  messageBox("You gave me " ~ received.code);

 });

 // need to run the event loop explicitly so main doesn't return
        // early and end your program; this will return when all windows are closed
 EventLoop.get.run();
} ```

You can also attach some user defined attributes to tell it which widget you want to control the thing (defaults are line input for string and int, drop-down select for enum, groups for structs... that's about all i bothered to implement so far, tbh my gui toolkit is more of a side project toy than a main event so the time i put in is limited), for example using `@ControlledBy!VerticalSlider(0, 100)` on an `int` to make it a slider from 0 to 100 instead of a text box asking for a number.

My menu thing uses this too, you can attach functions to menus and it can pop up a dialog. For example you might do `@menu("Search") Find(string text) { ... }` and let it auto-generate the menu and dialog box for it. I also have a `DataControllerWidget` which does the callback on any change event, allowing for real-time manipulation. I wrote a little blog post about this a couple years ago (seriously, i move sooooo slowly on this stuff!) http://dpldocs.info/this-week-in-d/Blog.Posted_2020_11_02.ht...

I'd love to spend more time on this, I think it is really cool, but tbh I haven't gone too far beyond the basics and since day job has no use for such stuff it gotta be squeezed into when i feel like doing code on the weekend.

Re: PysimpleGUI

#124

What's the solution for shipping a desktop Python app these days? I use Python a lot for small internal tools and always land up having to ship it as part of a web service and build a web UI for it so staff can use it as "set up conda, install the deps and run python ... " doesn't fly

I've had good experience with PyInstaller across macOS, Windows, and Linux.

I've mostly used PyQt5, and it's able to package that without any extra effort.

I use the "package it all into one file" option: it's a little slow to start, but for my purposes (primarily, longer-running applications) that's ok.

Re: PysimpleGUI

#125
post #118

As a developer for a Python GUI application [1], I think the biggest problem with using Python for desktop applications is the packaging. All existing tooling for creating a distributable binary either stops working or starts to require nontrivial hacks once you have more than a few dependencies. Even popular packages have issues. You get cryptic missing hidden import problems and missing data files that you didn't k…

Python has zipapps (https://peps.python.org/pep-0441/), which are standardized and similar to JARs. You can build a zipapp that includes your application's dependencies using a tool like shiv or PEX, only with binary extensions the artifacts are still per-platform: https://github.com/linkedin/shiv#gotchas.

I recommend users to install my Python programs with pipx (https://github.com/pypa/pipx). I think it is the best option when the audience is at all technical. pipx makes such a big difference for managing Python applications. It avoids the version conflicts of `pip install --user` and the pain of manually creating per-application venvs. In general, it provides a reasonable user experience. Because of this user-friendliness, I can recommend pipx as the primary installation method and expect people to succeed at installing the program with it. (I don't see issues about pipx installation in the trackers of projects that recommend it.) My programs have binary dependencies but no GUI.

Re: PysimpleGUI

#126
post #15

Earlier quoted context omitted.

As a user, definitely not. Web apps are slow, require an internet connection, don't integrate nicely with my OS, and generally inferior to native GUIs in just about every way.

Python is such a nightmare to package and use for users, especially for Gui, that even web apps can be better.

That's the myth, but really, there are several ways of doing it that are really quite easy.

PyInstaller is a good starting place. There are several others with similar capabilities.

Re: PysimpleGUI

#128
post #121
post #29

What is the recommended modern way to write GUIs in Python? Assume I'm in Python 3.12 and have a Poetry project as my management solution and that I have general software and GUI experience. What do I use? My application might have lots of streaming data to be plotted, streaming images to be displayed, lots of buttons and other elements. Is it PyQt6 with PyQtGraph? I don't want it to look like a Python app.

For native GUI, DearPyGui[0] as modern as you can. For browser web-based GUI, you can use nicegui[1] [0] -- https://github.com/hoffstadt/DearPyGui [1] -- https://github.com/zauberzeug/nicegui

Besides being intermediate mode-only, how does it compare to PyQt? How well does it do for streaming data to charts?

Re: PysimpleGUI

#129
post #128
post #121

Earlier quoted context omitted.

For native GUI, DearPyGui[0] as modern as you can. For browser web-based GUI, you can use nicegui[1] [0] -- https://github.com/hoffstadt/DearPyGui [1] -- https://github.com/zauberzeug/nicegui

Besides being intermediate mode-only, how does it compare to PyQt? How well does it do for streaming data to charts?

For the charts, they use implot[0], it's written in C++. You can interact with the demo website[1] if you want to get a feel of the real-time plotting.

[0] -- https://github.com/epezent/implot

[1] -- https://traineq.org/implot_demo/src/implot_demo.html

Re: PysimpleGUI

#130
post #67

The examples look straight up taken from the 90s esthetically [0]. Don’t get me wrong, for prototyping/internal tools that need a GUI to be usable by people not tech savvy enough to use a CLI it’s perfect, but what about the cases where you want things to look good? While native UI are always best for performance etc, I’ve always found them harder to style than a webpage. What is the equivalent of components (listed…

what's wrong with the 90s look? many people like it. I hate the new generation of UIs: acres of whitespace, buttons that don't look like buttons, disappearing scrollbars, hamburgor menus.

>acres of white space

I recently tried overwatch and I seriously cannot find a single damned thing in that UI.

Unlabelled buttons. Shit in completely random places. Extra buttons where not needed just to insert ridiculous white space. Components that don’t have functionality you expect, which is only granted by happening in to the similar component from a different pathway.

What an utterly idiotic UI. If you are a manager at blizzard, please fire these bone heads that did this.

Post reply on HN