Live data from Hacker News

Show HN: Cross-platform desktop applications with PyQT

github.com

171–180 of 293 posts

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

#171

Unfortunatelly PyQt does not solve the problem of Javascript engineers who are not willing to learn a new programming language. That's the whole reason for the whole Javascript fadigue. Computer Science has had "had tools for the right jobs" for years, but now we have a large developer base that only knows Javascript and think it's some kind of holy grail of computing. Happened before with Java. Happened before with…

People like you hate the idea of using JavaScript to write desktop apps because you feel like the end result is too slow and inefficient.

Web developers hate the idea of using C++ to write desktop apps because the language is brittle, outdated, and overly complex.

We need a middle ground: a language with the syntax of a scripting language, like Python or JavaScript, that compiles down to native code, like C++ or Rust.

I am under the impression that Qt is attempting this with QML and JavaScript.

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

#172

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, which won't happen if you get your underscores wrong in your example.

> Edit: removed erroneous formatting

This is beautiful!

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

#173
post #41

I have been developing in HTML/Python for a while now. This works wonderfully. You just need to put all your business logic in Python, use PyQt to run all the platform specific code like file dialogs, printing, etc. but keep the main interface with React. You do that by having a webview with a service object being the bridge between Python and the JS view[0]. If you are a bit careful with the amount of information go…

I'm assuming this is a desktop app, not running off a server. How do you get round the problem of distributing Python with every install? Or do you just accept it? I love Qt in C++ because most of the time the code just recompiles between Mac/Windows/Linux. I've shied away from writing GUIs in Python because deploying - to the point where a non-technical user can run the program - always ends up being hacky.

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

#174
Coding is only a part of my job. I am currently building an application for our warehouse, connecting our ERP to some external services. Lots of moving parts across several machines. In the middle is a tiny GUI, which has been more trouble than the rest put together. I used Tkinter to minimise dependencies. I am staggered by how much code it takes to get a GUI working (compared to the rest of the project), and this is just a plain industrial app. I'm sure this is part of the reason why JavaScript is taking over the desktop. Visual Studio had me making apps like this in minutes last time I used it (some time ago). Where did we go wrong?

I recently wanted to dabble with a tiny Android app, after hours wasted trying to get Kivy to work I bought a book on Kotlin and downloaded Android Studio, lots to learn but with the advantage that it works.

If I had just learnt JavaScript instead I could have done both in one hit.

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

#175
post #93
post #69

Earlier quoted context omitted.

No, please do. Explain to users why you need that, and why you feel you are important enough to bypass and ignore all of the existing design guidelines and patterns of whatever OS I'm running on. And why you feel you have to use up all of my CPU and memory to do so.

For the last time, "existing design guidelines and patterns" is a myth. Even Apple only really hits that (and barely) on iOS; MacOS UI consistency is a mess. Furthermore, most people do not care about this, and the value of marketing with a sleek design vastly outweighs any benefit of conforming to system components UI. If literally every Electron app fixed memory issues and correctly placed OK/Cancel dialog buttons,…

"For the last time, "existing design guidelines and patterns" is a myth."

No, they aren't.

"MacOS UI consistency is a mess."

Not really. Most small developer programs I use follow these. It makes it really easy to know what to do to accomplish something.

"Furthermore, most people do not care about this"

[Citation Needed]. I think most people would prefer to not have to learn a new UI from scratch everytime they want to use a different app.

"and the value of marketing with a sleek design vastly outweighs any benefit of conforming to system components UI."

What is this "value"? How does that help me accomplish my tasks?

"If literally every Electron app fixed memory issues and correctly placed OK/Cancel dialog buttons, I'd be fine with it for the rest of my life"

You mean, if every Electron app stopped being Electron?

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

#176

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…

I'd wager the Windows download is not the full app, rather just an installer. There's no way Qt and PyQt would fit in just 1MB on an OS that doesn't include those as shared libraries. As a side note: I see the Arch Linux package is 16M, unlike Ubuntu's 39M. Perhaps the app needs a relatively recent Qt or PyQt release that is available from Arch's repos but not on the oldest supported Ubuntu and thus needs to be shipp…

Yeah, I finally got windows version to download (cut out a few times, HN overload?). The win download is an online installer, so the size makes much more sense. I didn’t check the install directory, but it took 2 minutes to retrieve on slowish WiFi, so I would expect the install size is in-line with the others. (Good point about Arch).

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

#177

Unfortunatelly PyQt does not solve the problem of Javascript engineers who are not willing to learn a new programming language. That's the whole reason for the whole Javascript fadigue. Computer Science has had "had tools for the right jobs" for years, but now we have a large developer base that only knows Javascript and think it's some kind of holy grail of computing. Happened before with Java. Happened before with…

Which is unfortunate, because most apps don't have a lot of business logic to them. Most time is spent learning the interface and libraries...it might as well be a different language or something better suited to task at hand. For a crud app I'd generally grab for Qt, for a multimedia app or game I'd grab for SDL.

I guess with something like React there's even more overlap in UI and application flow, but you still have to learn interacting with the filesystem, dialogs, preferences, menus, menu icons and window settings, state between launches, and any other fiddly things that your app brushes up against. There's also building and packaging, bundling for the app store (if you're using one), and updating the app.

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

#178
post #3

Not directly related to the initiative itself, but comparing and contrasting the Electron website vs. PyQT is striking: https://riverbankcomputing.com/software/pyqt/intro https://electronjs.org/ I've been a (proud) Pythonist for years now, and I've always been a bit chagrined by the quality of the "marketing" of Python projects. It doesn't at all reflect the quality of the community and the projects.

I prefer the pyqt website. No stupid animations. No bullshit. Just clear links to all the information you need, easily available docs, etc. I mean, it's kind a real reflection of the two frameworks. Do you want a framework that requires a 90MB payload with it that's a resource hog and a web browser or do you want something small, light and works?

We want that, but we are the minority.

I do agree that PyQt has a respectable documentation page. It is, however, a terrible page for attracting new developers and selling decision makers on the idea of using it.

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

#179
post #3

Not directly related to the initiative itself, but comparing and contrasting the Electron website vs. PyQT is striking: https://riverbankcomputing.com/software/pyqt/intro https://electronjs.org/ I've been a (proud) Pythonist for years now, and I've always been a bit chagrined by the quality of the "marketing" of Python projects. It doesn't at all reflect the quality of the community and the projects.

It does reflect the priorities of the community, though. PyQT's page is clearly written by a developer, with an emphasis on explaining the internals of the library. The author clearly saw no need to make it attractive. There is no long-term vision beyond the library itself. While PyQT is navel-gazing, Electron's page is all about grabbing mindshare and establishing clout. It seeks to conquer the world and your deskto…

As a developer consuming the PyQT API, explanations of internals have come in handy.

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

#180
post #160
post #55

I wish them the best of luck, but I don't think it's going to happen, because one of the big reasons Electron is popular is because web-dev people don't want to learn other languages.

This trope makes me quite sad... I'd love to learn other languages and stacks! It's just that, often, it isn't a worthy use of my time. All that time used into learning C++ and Qt would be better used in making and improving my software. This is even more impactful when hiring people. I'm building a small team that has to handle Web development, mobile apps, and someday a desktop app. The less different skills I need…

"I'd love to learn other languages and stacks! It's just that, often, it isn't a worthy use of my time. All that time used into learning C++ and Qt would be better used in making and improving my software."

This line of thinking, that it's not worth your time to learn tools that would improve your software, and make it less resource intensive, is a large reason for that trope.

"Many are using web tecnologies because of the fads, and some out of lazyness, but many (i'd guess most) are doing it because it's worth it."

I can't agree with this, mainly because, it's not worth it. It doesn't improve the software in any way; if anything, it makes it worse.

Post reply on HN