Live data from Hacker News

PysimpleGUI

github.com

151–159 of 159 posts

Re: PysimpleGUI

#151
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…

Pipx still breaks. I tried to use something a few days ago that had been working until a month ago and it failed with some useless generic python error that I can't remember. I looked at the code in the /usr/bin/thing and it was just a wrapper. After following the rabbit around I just uninstall pipx, install it again, and then reinstall the thing that I was originally trying to use. No idea what broke it, perhaps a python update or something. The 'dead' version is probably still hanging around in my home directory taking up space somewhere.

Python absolutely sucks in this regard and I don't think there is a permanent solution. Except give python a compiler that can spit out binaries and libraries. I wish nim was 100% python code compatible.

Compiled binaries with shared libs work fine as long as they come from an OS package repository. Statically compiled binaries work almost everywhere. But a script that needs a bag of other specifically versioned scripts needs to live in it's own (sometimes impossible) world. Hell, I've even had a single pip install on a clean system fail because two dependencies of the module I was installing wanted different versions of some common dependency. Gah, burn it with fire.

I'm always amazed at the Windows ecosystem. I can download something that was built in the 90s and happily run it in wine.

Re: PysimpleGUI

#152
post #3

I have one comment, and I hope it's not rude: There is too much text. Everywhere where you can put text, the author put a lot of it. Sentence after sentence, rambling on. Coherently so, most of the time, sure, but just one after the other and not a single relevant screenshot for the first thousand words. Something is not right here. Either this is a joung enthusiastic coder, which is probably the case, or there is so…

Each section has a clear heading. If you don't care about a section, all you have to do is scroll a little bit. No one is forcing you to read the "about me" section. Some people actually enjoy reading about tools, rather than just looking at it from an entitled viewpoint of "what can I do to get this running as fast as humanly possible while reading as minimal words as possible". This is a tool that someone else wrot…

I'm just not going to use it, yes, i felt like it was only fair to say why

Re: PysimpleGUI

#153

Earlier quoted context omitted.

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…

Pipx still breaks. I tried to use something a few days ago that had been working until a month ago and it failed with some useless generic python error that I can't remember. I looked at the code in the /usr/bin/thing and it was just a wrapper. After following the rabbit around I just uninstall pipx, install it again, and then reinstall the thing that I was originally trying to use. No idea what broke it, perhaps a p…

Yeah, I've had pipx break once with a generic error. It was after a Python version upgrade. I also ended up reinstalling pipx and the applications to fix it. I should qualify my recommendation. With pipx, your application will very likely install and work correctly, but it won't necessarily stay working when the Python installation changes. A self-contained binary is better in this way.

I don't see Python packaging and dependency management as a bulldoze-everything-and-start-over disaster anymore. Thanks to improvements like wheels, manylinux, `pyproject.toml`, https://peps.python.org/pep-0517/, and Poetry/PDM/Flit/Hatch/etc. they are increasingly adequate.

I have compiled a Python application to a native binary with https://github.com/Nuitka/Nuitka. Once I got it to compile, it fully worked. The process was a little fiddly, although I don't remember the exact problem. In the end I set up a Docker container for the build, and then it built. Maybe Mojo will be what you wish Nim was.

For standalone scripts, there are options. (My list: https://github.com/stars/dbohdan/lists/python-scripts-with-d....) Support for scripts should be coming to pipx. I have used the development version and liked it. This is an area where things are actually pretty good but not common knowledge.

> I'm always amazed at the Windows ecosystem. I can download something that was built in the 90s and happily run it in wine.

https://blog.hiler.eu/win32-the-only-stable-abi/ :-)

Re: PysimpleGUI

#154
post #20

I'm surprised that nothing has filled the void that VB6 left behind in the rapid application development space. The language wasn't great, but VB6's strength was the drag and drop GUI builder.

VB6's strength was that Windows was a virtual monopoly at the time. Today you have more fragmentation, where the user masses are still mostly on Windows but the developers are mostly on Macs or Linux. Developing a desktop GUI framework for a single platform is relatively easy. Developing a cross-platform GUI framework for three or more platforms is extremely hard. And a lot of people would STILL ignore it if it's not…

> but the developers are mostly on Macs or Linux.

Is that really true outside of web devs?

Re: PysimpleGUI

#155
post #144

Earlier quoted context omitted.

PyInstaller does not require that the target machine have Python installed. And it will produce a single-file executable that bundles the interpreter, application Python code, extensions, and any other resources (data files, images, fonts, etc). Both numpy and pytorch are explicitly supported, although that's not guaranteed for all extension packages.

Is that new? That's awesome to hear actually.

None of that is new, it's been the way PyInstaller always worked.

However on Linux things kinda suck because PyInstaller will package your current interpreter, so if it's linked against things that are different on another Linux (eg no glibc) it will often crap itself. But so is the joy of distributing compiled software to Linux users :).

Re: PysimpleGUI

#156

Earlier quoted context omitted.

What risk? Other users on the same system accessing the web UI? That can be mitigated with a token included in the browser launch URL, but it seems like a pretty unlikely vector anyway, someone would have to write code that specifically knows about SyncThing, and then convince you to install it, and then you'd have to not use password protection.

Opening your computer to network. Incorrectly configured folders for sharing could end up wiping out your data (no warning or chance for recovery, unless you configure file versioning- which is confusing AND off by default). WebUI not configured with a password by default, allowing multi-user systems to access your files.

All of your complaints are specific to Syncthing which, admittedly, doesn't have great defaults (but the fans will be quick to defend it).

A webui for a desktop app can be made perfectly securely, though.

For example it can bind to 127.0.0.1, not do external network requests, and require a token (generated by a systray menu utility or an app shortcut for example) that will prevent automated exploits from accessing it as well as other users on a multi-user system.

Re: PysimpleGUI

#157

Earlier quoted context omitted.

Is that new? That's awesome to hear actually.

None of that is new, it's been the way PyInstaller always worked. However on Linux things kinda suck because PyInstaller will package your current interpreter, so if it's linked against things that are different on another Linux (eg no glibc) it will often crap itself. But so is the joy of distributing compiled software to Linux users :).

This is a genuine issue, and it takes some work to avoid.

I typically use an older distribution as my build box: this means that the dependencies pulled in by the interpreter are older versions, and when it runs on a newer distribution, the backward compatibility for libraries will ensure it works ... usually.

I've messed about with using a completely independent build tree for this: something that depends on libc/libm/etc only from the OS, and all other dependencies are part of my build. That seems like it works pretty universally, but it's a lot of work.

I've been meaning to look into leveraging the Flatpak runtimes for this: they seem like they have pretty similar concerns.

Re: PysimpleGUI

#158

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…

The problem is that Tkinter (at least for Windows) is really based on 90s widgets. You could set PySimpleGUI's theme to "SystemDefaultForReal" but it will still look out-of-place because the native Windows widgets has that modern look while Tkinter has never been updated at all.

Re: PysimpleGUI

#159
post #20

I'm surprised that nothing has filled the void that VB6 left behind in the rapid application development space. The language wasn't great, but VB6's strength was the drag and drop GUI builder.

Drag and drop UI design kept me using qtcreator for way longer than I would have otherwise. Usefully, you can just plonk the layout file next to your python script to use it with pyqt, since the IDE's python support isn't great. (may just be my borked install)
Post reply on HN