Live data from Hacker News

PyQt5 Tutorial: Create a Python GUI in 2018

build-system.fman.io

181–190 of 211 posts

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#181

Earlier quoted context omitted.

Looking at a tutorial, it looks like all it does is layout the form for you. That's a shame. Things closer to what the original VB was are sorely missed in modern computing.

If you want VB/Delphi-style app builder for Python, can I interest you in Anvil ( https://anvil.works )? It targets the web, but you write all the code (even client-side) in Python. We've had multiple customers describe it as a worthy heir to Delphi :)

> It targets the web

Thank you, but no. It doesn't fit the philosophy of the system I'd want to include it in.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#182

We use Qt heavily at Starsky Robotics. We initially used it because it has tight integration with ROS via RQT [1], but I'm pretty impressed with the framework in general. Lots of great tools out of the box, QtCreator is awesome and once you get the right signal/slot model in your head everything is a breeze. Plus getting to prototyping in python is always fast! For our use case, relative speed of the GUI isn't a fact…

What's the memory consumption of pyQT compared to electron apps?

For a JavaScript alternative to pyQT I recommend proton-native[1] - a React environment for cross platform native desktop apps.

1: https://github.com/kusti8/proton-native

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#183

In commercial settings, I wonder how hard it really is to package this up? I've been building/distributing fully cython'd installers for a while (to sort-of hide the source as well as make a convenient package)... I wonder if that would be harder with PyQt for some reason? "In the Python world, the process of turning source code into a self-contained executable is called freezing. Although there are many libraries th…

http://nuitka.net/ is what you are looking for. It's robust, proven, does work well with C extensions (including numpy and QT) and produces stand alone binaries. You can produce binaries for Windows, Linux and Mac (but not cross compile). It works by turning the whole Python code into C before compiling the result. The additional benefit of that is that you gain a bit of execution speed. The project is amazingly litt…

Well, on my last project, I found PyInstaller to work best and Nuitka changed too many things about the environment.

PyInstaller felt quite close to an auto-unzipping python interpreter and your code, simple.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#185

This is a case where the "in 2018" in the title is very helpful, as Googling information about Python and Qt usually returns something dreadfully out of date. (and as other comments note, there are lots of new companion tools/competitors like Electron)

The API still looks messy and unpythonic though, sadly. Look at the basic hello world example. Why do I need to pass QApplication an empty array? Why am I calling a method ending with _ to launch the program? And the fact the label magically attaches to the app through some side effect is also confusing. Does anyone know if there's any good shim/wrapper around PyQt that has a better API?

Not exactly what you're asking for, but QtPy - https://github.com/spyder-ide/qtpy - is a nice abstraction layer that sits between your program and either PyQt5 or PySide2.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#186
The hardest problem in this space is not writing the code, but packaging the app. All the freeze utilities have their quirks which ensure no one solution works for all three OS consistently.

Even Dropbox had to rewrite their packaging to ensure maximum system compatibility (https://news.ycombinator.com/item?id=18067784)

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#187

The hardest problem in this space is not writing the code, but packaging the app. All the freeze utilities have their quirks which ensure no one solution works for all three OS consistently. Even Dropbox had to rewrite their packaging to ensure maximum system compatibility ( https://news.ycombinator.com/item?id=18067784 )

https://github.com/pybee/briefcase looks promising.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#188
post #32
post #4

I like the tutorial, but I don't know why you would use PyQt these days. Tkinter is more permissive and has wrappers like appJar which make it disgustingly easy to put together a quick, ugly GUI. If you're building a desktop app that needs to really look good and be fast, why are you using Python?

I was recently surprised by how non-ugly a Python Tkinter app can look with some effort. Take a look at this: https://thonny.org/

It's beautiful! Close to the look of Bvckup 2 (https://bvckup2.com/ - cert revoked due to Chrome changes I think) which might be the best looking Windows app I've seen in a long time.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#190

The hardest problem in this space is not writing the code, but packaging the app. All the freeze utilities have their quirks which ensure no one solution works for all three OS consistently. Even Dropbox had to rewrite their packaging to ensure maximum system compatibility ( https://news.ycombinator.com/item?id=18067784 )

I created https://build-system.fman.io to help with this exact (general) problem.
Post reply on HN