top | item 30819136

Python and Qt simplified

186 points| BerislavLopac | 4 years ago |build-system.fman.io | reply

91 comments

order
[+] Thales|4 years ago|reply
Free fbs doesn’t work with recent versions of python (>3.6) [0]. You need to pay or migrate. This can lead to security issues because recent packages don’t always work with older python versions.

[0] https://build-system.fman.io/manual/#requirements

[+] brnt|4 years ago|reply
This. Python 3.6 is out of support now, 3.11 is about to be released. It's not really usable anymore.
[+] spicybright|4 years ago|reply
Ha, I used pyinstall and QT for the first time during a one off project. Smoothest GUI development I've ever done coming from knowing nothing about the stack. Esp. pyinstall. Had to do literally nothing for win/mac/unix builds.

To be fair though, it was a relatively simple app, but I feel that's the typical use case if you're already proficient in python and just want to add some buttons.

I don't hear about using this stack much, so I'm glad it's getting improvements + more attention!

[+] m3nu|4 years ago|reply
At Vorta (https://github.com/borgbase/vorta/) we're also happy users of the PyQt + PyInstaller stack. Not really needed for Linux, but great for macOS. It's even possible to use Sparkle via PyObjc for automatic updates. Be sure to build "appdir" packages to get a proper macOS package that can be notarized with Apple.
[+] quirino|4 years ago|reply
I wrote a small Python program for a group of non-tech people, and all throughout development I was dreading how much time I was going to have to spend helping everyone through the installation process. But Pyinstaller made it as simple as "download and run". Super quick to set up and no one had issues at all.
[+] maleldil|4 years ago|reply
Pyinstaller can be a nightmare depending on what dependencies you have. I believe it doesn't copy data files by default, so you have to either write a spec file for the library or include those files yourself in your program spec.

After everything is set up, though, things usually work smoothly.

[+] mherrmann|4 years ago|reply
Author here, thank you for sharing. Will be happy to answer any questions.
[+] bscphil|4 years ago|reply
The top comment in the thread says

> Free fbs doesn’t work with recent versions of python (>3.6)

Is this true? What are the plans (if any) to update the GPL version of the project?

[+] pacifika|4 years ago|reply
Would you consider a refund policy or dry run trial with pro home?

The free version doesn’t support modern Python versions so to see if it works.

[+] jll29|4 years ago|reply
Congrats on the Tony Hoare prize, that's very impressive, Michael.
[+] maleldil|4 years ago|reply
I haven't used fbs, but fman is great. Thank you for your work.
[+] akselmo|4 years ago|reply
Any plans for Appimage/flatpak build support for linux?
[+] BlueTemplar|4 years ago|reply
And for those who would need Python and Qt "complexified" :

https://www.pyqtgraph.org/

> PyQtGraph is a pure-python graphics and GUI library built on PyQt / PySide and numpy. It is intended for use in mathematics / scientific / engineering applications. Despite being written entirely in python, the library is very fast due to its heavy leverage of NumPy for number crunching and Qt's GraphicsView framework for fast display. PyQtGraph is distributed under the MIT open-source license.

[...]

> Packaging for Distribution Applications written with pyqtgraph may be packaged as Windows exe files using py2exe or OSX dmg files using py2app.

[+] spdegabrielle|4 years ago|reply
This should not be this hard or expensive. Racket can do this out of the box. I’m sure there are better ways to do this in Python.
[+] nopenopenopeno|4 years ago|reply
I used this project once and it was a huge distraction. It also ended up making us have to pin the whole project to python version 3.6 when 3.9 was out because it wasn’t sufficiently maintained itself.

It was much more sustainable and maintainable to just write our own build scripts for each platform with template tags and automate from there.

[+] brnt|4 years ago|reply
I'm a satisfied user of cx_Freeze in combination with Qt, but I only build Windows installers, so YMMV.
[+] spectrallus|4 years ago|reply
I have owned this sowftware for about a year and can say the author did a good job. It's worth it.

With that said, this may not necessarily be fault of the authors, but the tutorial and documentation really doesn't help. The Qt and PyQt/PySide ecosystem is so fragmented that understanding how to truly use fbs only came to me after months of browsing github for example code.

Something like a video tutorial series on YouTube that shows how to use Qt Creator with QWidgets with fbs would be great then another on how to use Qt Design Studio with QtQuick with fbs would be amazing.

[+] vanous|4 years ago|reply
> fbs's source code is available on GitHub. You can use it for free in open source projects licensed under the GPL.

> The free version of fbs has several limitations. Upgrade to Pro to unlock its full potential. Upon purchase, you'll receive a hosted package that you can install just like fbs. No messing around with license keys. Just pip install and you are done.

So it is more like open core. This is fine, just not clear from the front "features" page listing.

[+] ognarb|4 years ago|reply
I'm getting annoyed at project saying that they are open source and then it turns out they are actually open core. I'm fine with dual licensing but not with false marketing.
[+] bscphil|4 years ago|reply
It's actually a bit worse than open core, in that the closed source version of the program works with versions of Python that have not been end-of-lifed [1] but the open source version of the program does not [2]. Because of that I'm not comfortable calling this open-anything.

This is a closed-source program that used to have a open-source version, which is now abandonware.

[1] https://devguide.python.org/devcycle/#end-of-life-branches

[2] https://build-system.fman.io/manual/#requirements

[+] BiteCode_dev|4 years ago|reply
Open core is open source, just a layer on top of it. All the freedoms of FOSS are guaranteed for the software in the repo you are looking at.

The fact they make money by providing even more doesn't make it less open source.

[+] lrem|4 years ago|reply
I already have a Qt app I would like to package now (https://github.com/lrem/FastCull). Would fbs be something to look into, or should I investigate some alternative at this point?
[+] Kelteseth|4 years ago|reply
Weird that this project does not use Qt Installer Framework that already works cross-platform.
[+] paulryanrogers|4 years ago|reply
QIF didn't work for me. Updates weren't detected and it didn't have support for Windows registry. I also got the impression it's in maintenance mode and not widely used.
[+] eql5|4 years ago|reply
Sure, but this project probably predates the Qt Installer.
[+] jollybean|4 years ago|reply
Anyone care to comment on 'Why Python'?

Javascript is quite commonly established as a good UI language these days, and I assume that anyone who can write Py can write Js.

Is there something particularly useful about Py, i.e. perhaps researchers who know Py may not want to bother to switch? Or that it integrates better with some things? Or that it's used widely at a company and investing in a second language is a big deal?

[+] uranusjr|4 years ago|reply
My guess is it’s because PyQt. AFAIK there’s not a JS binding (or any other language really) for Qt that’s nearly as established and steady. If you’re going with Qt, Python is the most reasonable choice (other than native C++ of course).
[+] digisign|4 years ago|reply
Historically it was a much more productive choice, than just about anything. Today it's merely an arguably more productive one. In any case it remains a good choice, and one of the most popular languages.

Despite years of FUD from the likes of Microsoft and others, "investing in a second language" is not a big deal at all and just short of required for projects of any complexity.

[+] bscphil|4 years ago|reply
What libraries should I rely on to create cross-platform native (or native-approximating) UIs in JS?
[+] pacifika|4 years ago|reply
A preference for developing in Python.
[+] Lucasoato|4 years ago|reply
Do you know if there are free open source alternatives to fbs and qt?

I mean free both as beer and freedom.

[+] scarygliders|4 years ago|reply
If you install PySide/PySide2/PySide6, you don't need to install Qt as well.

Included with PySide[2|6] is QtDesigner, hidden in the distribution but available for use, and all the compiled Qt libraries.

The application created from that can be released closed source as using Qt under LGPL.

As for packaging;

Use PyInstaller, which creates a dist directory. Included in that dist directory will be everything needed to run your Python/Qt application.

Use Inno Setup/Inno Script Studio (https://jrsoftware.org/isinfo.php) to package that dist folder into an installer.

The end result will be a self contained installer which acts just like any other Windows software with an installer.

I use all the above to create and distribute Captain's Log (https://captainslog.scarygliders.net)

[+] spacechild1|4 years ago|reply
Qt is available as LGPL.
[+] systemvoltage|4 years ago|reply
The problem with QT is its license. All commercial applications I've seen are pre-v6 due to GPL license.
[+] detaro|4 years ago|reply
That doesn't make any sense, not much relevant about which modules are GPL has changed with the release of Qt6. Not that the licensing situation doesn't have problems, but that specific thing can't really be it.
[+] hereforonep|4 years ago|reply
Reading articles like this is why you understand why webapps have unfortunately won
[+] boondaburrah|4 years ago|reply
I'm not sure what particularly you mean about this article since it seems a lot easier than webdev to me. Javascript devops and Webpack in particular drive me up the wall. Qt is usually click-button-receive-EXE (when using an IDE, otherwise qmake is pretty painless) and this seems like the equivalent in just "fbs freeze"?
[+] danielvaughn|4 years ago|reply
Not sure why you’re being downvoted - you have a point. I’m a web dev, and once tried dipping my toes into building a native GUI. I didn’t last long.
[+] jasfi|4 years ago|reply
Flutter is cross-platform, including the web. I'm working on an SDK that allows for back-end powered UIs that uses Flutter on the front-end: https://nexusdev.tools/
[+] galangalalgol|4 years ago|reply
I get your point, but I wonder if the development being easier is a symptom of it being dominant rather than the cause. Web apps have a lot of other benefits that might have been the cause. I'm not a web dev, I mostly work embedded or HPC and my dev environment is either vscode or vim depending on my mood. I use plenty of cli native apps, but vscode and matlab are the only native GUIs I use. Is web development mostly done on web apps? Trying to develop in gitlab has always been painful to me for non trivial changes. It seems like anything that doesn't have huge files to move about like photo,audio or video editing could be a webapp.
[+] knighthack|4 years ago|reply
This is really a symptom of the packaging scenario in Python, more than anything else. Web-apps have a lot of advantage in that regard, but desktop apps have their place, and I hold hopes that Python will come forward with better packaging tools in the long run.
[+] varajelle|4 years ago|reply
Because there is no need to package/deploy web apps?