Live data from Hacker News

PyQt5 Tutorial: Create a Python GUI in 2018

build-system.fman.io

61–70 of 211 posts

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#61
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/

that's an interesting definition of "non-ugly". I would hesitate a lot before making an app that looks like this screenshot public.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#62

Earlier quoted context omitted.

Thank you for not using Electron.

All of our end users are internal, so the main bloat-related problems wouldn't really be an issue at all. Why should we be worried about electron in the future?

Electron is notorious for disregarding all platform conventions, being slow, and being a memory hog.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#63
post #36

Earlier quoted context omitted.

PySide2 is now out of beta?

It's still just a "technical preview", but I've been using it for a while and didn't have any problems that weren't caused by me not knowing how Qt works. Some of the examples in the documentation are still in C++, but it's pretty easy to translate them to Python since the names are the same. (Sometimes painfully so, e.g PySide2.QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff .)

Agreed. I dabbled with Pyside2 recently and it was refreshingly well structured compared to PyQt4, which is what I last used when I built a GUI a few years ago. It looks like the community might finally get behind one, good, open library for Qt5.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#64

I wish all the effort to make Qt available in Python was going in to exposing a C API. I of course know this is difficult due to Qt relying on OO extensibility in many cases and I am aware of many efforts in many languages that just use the C++ API directly by essentially building their own C API layer. That I have to choose between C++ or Python makes it very difficult for many use cases in other languages. What ess…

I built a C-layer myself for use with C#.

https://github.com/qmlnet/qmlnet

It worked out nicely.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#65

Earlier quoted context omitted.

I assume learning to build interfaces in Javascript allows you to port that skill to both the desktop environment (via something like Electron) or web environment through a browser.

Exactly this. Javascript frameworks allow overlap. I'm using the same tools and language to create a UI. Don't get me wrong I like QT apps and still tinker with them periodically. I will probably use them more once Go finds a way to make truly portable UI applications.

I guess that's cool if you mostly do web stuff. But there are tons of developers that use Python/C++ for embedded systems, OS, data science and other things that could make the same argument for Qt.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#66
post #7

As someone who works with Windows forms, I'm wondering where the visual designer to place widgets is.

In addition to what the other said, if you use Qt Quick instead of Qt Widgets you get something which is an order of magnitude more powerful than most of the alternatives :

* http://blog.qt.io/blog/2017/07/05/qt-quick-designer-coffee-m...

* http://blog.qt.io/blog/2017/05/24/qt-quick-designer-qt-creat...

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#67
I'd like to take this time to introduce a project I have been working on. I'm using it in production currently.

https://github.com/qmlnet/qmlnet

It is a perfect balance between QML and .NET. The tech stack splits along the perfect line. QML for UI, .NET for business logic.

I'd be glad to answer any questions.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#69
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 that address this issue – such as PyInstaller, py2exe, cx_Freeze, bbfreze, py2app, ... – freezing PyQt apps has traditionally been a surprisingly hard problem.

We will use a new library called fbs..."

click to fbs...

"You can use fbs for free in open source projects that are licensed under the GPL. If you don't want to open your code up to the public, you can purchase a commercial license for EUR 249 per developer"

I'd happily pay the 250 euros but I somehow doubt fbs will also convert my code to C and compile it.

Re: PyQt5 Tutorial: Create a Python GUI in 2018

#70

Earlier quoted context omitted.

Thank you for not using Electron.

All of our end users are internal, so the main bloat-related problems wouldn't really be an issue at all. Why should we be worried about electron in the future?

I have 3 "internal" tools in electron I need to have running all the time on my PC... It's a corporate dell mini PC, poor thing.
Post reply on HN