Live data from Hacker News

Show HN: Cross-platform desktop applications with PyQT

github.com

131–140 of 293 posts

Re: Show HN: Cross-platform desktop applications with PyQT

#131
I am curious about final package size on various platforms when using this project. The download bundles for the related "fman" project vary considerably -- Win: 1MB; macOS: 23MB; Ubuntu: 39MB. The last number matches my experience with scripted Qt applications, at which point the size is comparable to a typical ~50-70 MB Electron app, at least for compressed downloads. Visual Studio Code is 44 MB on Windows and 65MB on Mac. Scriptable wrappers usually imply that the core Qt shared objects can't be pruned, and the wrappers themselves also add up, so that Windows number is impressive and intriguing!

I would also wonder about performance scaling. Are there good examples of "large" applications where CPython drives the main loop, as opposed to a scripting layer over a C++ core? CPython has a shallower optimization floor than Javascript+V8, and most larger Python GUI applications I've tried had noticeable lags (thinking of several visualization apps, and several Python-centric IDEs). I was similarly skeptical of Javascript-based desktop applications until recently, but Visual Studio Code has been very impressive.

Re: Show HN: Cross-platform desktop applications with PyQT

#132

Earlier quoted context omitted.

I would disagree with this as I've created many small apps using QT, and getting started is much easier than with Electron (in my opinion). It is as easy as this: import sys from PyQt5.QtWidgets import QApplication, QWidget if __name__ == '__main__': app = QApplication(sys.argv) w = QWidget() w.setWindowTitle('Hello, world!') w.show() Also, styling apps in QT is really easy, in fact you can even use CSS: http://doc.q…

At least in nw.js which is a similar toolkit to Electron: { "name": "helloworld", "main": "index.html" } And index.html is just whatever HTML web page you want, like " Hello World Hello World ". You could also use a javascript file as your "main" file if you want. Even when you screw up the HTML it will still load, which won't happen if you get your underscores wrong in your example. Edit: removed erroneous formattin…

> Even when you screw up the HTML it will still load

And this is why we have the wasteland of browser incompatibility that we're (still!) in. If something is wrong, it shoudn't work. Why are our standards so low that mistyping "head" as "herd" is considered something that heuristics should fix, rather than causing an error?

I mean, really, though, any decent IDE should flag that error for you in-line, anyway.

Re: Show HN: Cross-platform desktop applications with PyQT

#133
post #70

> "PyQt is dual licensed on all supported platforms under the GNU GPL v3 and the Riverbank Commercial License. Unlike Qt, PyQt is not available under the LGPL. You can purchase the commercial version of PyQt here. More information about licensing can be found in the License FAQ." Except this sucks if, you know, you want to make some money on your app... Kicking the tires for a potentially commercial app is a FULL sto…

If you don't want to pay for a commercial license, just use PySide. It's LGPL-licensed and has nearly exactly the same API as PyQT. So near that when I switched out PyQT with PySide, all I had to do was change two import statements throughout a ~3000 python gui application.

The last PySide release is from 2015 for Qt 4.8.

Re: Show HN: Cross-platform desktop applications with PyQT

#134
post #83
post #53

Earlier quoted context omitted.

Not that most companies would care, as dev cost seems to be all that matters these days, but the upsides are much faster and leaner applications than what you get from Electron.

Can't talk as to rendering and such, but python isn't going to be a performance win vs JS. V8 is faster than cpython by a decent margin for typical tasks on typical data structures. You'll need to dip into clang or whatnot for really hardcore perf either way

Performance of Python driving UI components implemented in C beats performance of JavaScript driving UI components implemented in JavaScript on top of the DOM.

Re: Show HN: Cross-platform desktop applications with PyQT

#135
post #110

Serious question: Why do so many people think building desktop application GUIs with web-technologies is a good idea? I'm currently trying to formulate some thoughts on this; While I understand that HTML/CSS generally seems more flexible and may be more easily accessible to more/newer devs, it carries huge, negative implications in the forms of HCI (not having consistent interface elements on the user platform), perf…

Because system resources are cheaper than expert knowledge.

We've got enough RAM & CPU cycles spare that we can run GUIs in a headless browser and CSS & JS have come along far enough to make this easy(ish) to pull off, especially when combined with a framework such as React or Angular.

I can see why it's done, from the cost PoV, but I'm always a little dismayed when I find yet another desktop app which has the 'uncanny valley' of an almost-native look and feel. Same goes for ReactNative vs true native mobile apps.

Re: Show HN: Cross-platform desktop applications with PyQT

#136
post #110

Serious question: Why do so many people think building desktop application GUIs with web-technologies is a good idea? I'm currently trying to formulate some thoughts on this; While I understand that HTML/CSS generally seems more flexible and may be more easily accessible to more/newer devs, it carries huge, negative implications in the forms of HCI (not having consistent interface elements on the user platform), perf…

There's demand for web devs in my area. Not so much for GUI people except for iOS/Android.

The market shapes the tech that's developed and companies shape the market.

It's a self-reinforcing vicious cycle of hype-driven demand.

Disclosure: I'm a web dev :(.

Re: Show HN: Cross-platform desktop applications with PyQT

#137
post #110

Serious question: Why do so many people think building desktop application GUIs with web-technologies is a good idea? I'm currently trying to formulate some thoughts on this; While I understand that HTML/CSS generally seems more flexible and may be more easily accessible to more/newer devs, it carries huge, negative implications in the forms of HCI (not having consistent interface elements on the user platform), perf…

Because system resources are cheaper than expert knowledge. We've got enough RAM & CPU cycles spare that we can run GUIs in a headless browser and CSS & JS have come along far enough to make this easy(ish) to pull off, especially when combined with a framework such as React or Angular. I can see why it's done, from the cost PoV, but I'm always a little dismayed when I find yet another desktop app which has the 'uncan…

So we're getting lazy because the availability of resources lets us. Got it.

Re: Show HN: Cross-platform desktop applications with PyQT

#138
post #110

Serious question: Why do so many people think building desktop application GUIs with web-technologies is a good idea? I'm currently trying to formulate some thoughts on this; While I understand that HTML/CSS generally seems more flexible and may be more easily accessible to more/newer devs, it carries huge, negative implications in the forms of HCI (not having consistent interface elements on the user platform), perf…

Because system resources are cheaper than expert knowledge. We've got enough RAM & CPU cycles spare that we can run GUIs in a headless browser and CSS & JS have come along far enough to make this easy(ish) to pull off, especially when combined with a framework such as React or Angular. I can see why it's done, from the cost PoV, but I'm always a little dismayed when I find yet another desktop app which has the 'uncan…

What's really "enough RAM & CPU cycles"? I think one can argue that this is really offloading development cost as a a resource cost onto the users - who must run "native", inefficient applications.

This means not only implicitly making a choice about the users' hardware, but it may in some cases exclude certain user segments as well.

Re: Show HN: Cross-platform desktop applications with PyQT

#139
I write desktop apps using PyQt and build an installer with pynsist. This is cross-platform, but I only need Windows support. Other than that, is this project just a simplified way to build desktop applications, or would it produce something fundamentally different from what I'm building now?

Re: Show HN: Cross-platform desktop applications with PyQT

#140
post #113
post #110

Serious question: Why do so many people think building desktop application GUIs with web-technologies is a good idea? I'm currently trying to formulate some thoughts on this; While I understand that HTML/CSS generally seems more flexible and may be more easily accessible to more/newer devs, it carries huge, negative implications in the forms of HCI (not having consistent interface elements on the user platform), perf…

It appeals to people who regard desktop resources (memory, CPU cycles, etc.) as functionally unlimited. Thus, there's no reason to worry about low-level efficiency, such as with C or C++. So why not use all the technologies you already know and use everywhere else, like JavaScript? I don't know if I agree that it's the best tool for the job, but I can see the appeal to someone whose world is JS and Python only. Espec…

I do Python and JS daily. Never had to do hand memory management in my life (maybe once in Objective-C).

Webdev is not the best tool for the job but it's cheaper and substitutes for a sleeve of other specialised tools.

The user experience is secondary if you do a product on a budget and iterate over it all the time. Especially if you are a web-first experience like Slack. Having native stuff there would make it even worse adding cognitive dissonance to the overall design.

I guess there's a method in this madness.

Post reply on HN