Live data from Hacker News

Hello Qt for Python

blog.qt.io

111–120 of 176 posts

Re: Hello Qt for Python

#111
post #48

Earlier quoted context omitted.

And it's generally worth it. PyQt has been great, and I find the messaging from Pyside a little offputting -- "finally, Qt for Python." Pyside, you weren't there when I needed you, and now you're back and you want to pretend like we don't have history?

When did you need it? Because PySide is not new.

PySide was stuck on Qt4 and basically stalled. PySide2 is practiaclly a new project. For Qt5 bindings, PyQt has been the only game in town for years, and Riverbank has done a damn good job of it.

Re: Hello Qt for Python

#112
post #107
post #89

Earlier quoted context omitted.

As you can see, Qt for Python is not yet stable release. So you will want to use PyQt5 first. I remcommand PyQt5 because there are more resouces available on the internet now. PyQt5 and Qt for Python is a 1-to-1 binding to the original Qt and their APIs are almost identical, so you should be able to switch to Qt for Python quite easily when it is stable. By the way, Qt for Python is re-branded from PySide2. They are…

Would it be as simple as a global change of all "from PyQt5" to "from PySide" in all import statements?

Almost, when switching from PyQt4 to PySide 1. It was roughly equivalent with some minor differences. It was much less work than switching Python 2.7 syntax to 3. There are some bindings as well [1].

I don't know much detail about PyQt5 vs PySide 2 but at least the overall logic should be the same.

[1]: https://github.com/epage/PythonUtils/blob/master/util/qt_com...

Re: Hello Qt for Python

#113
post #66

Earlier quoted context omitted.

What would you recommend to someone who wants to write Python desktop applications today? I've used wxWindows way back when, and I'd hate to use Electron. Would you go with Qt for Python, or PyQT? Also, what's PySide/PySide2?

Not OP, I've been very impressed with some enlightenment apps written using python. In particular: https://github.com/DaveMDS/egitu https://phab.enlightenment.org/w/projects/python_bindings_fo... Scroll down to "python projects using EFL".

I had not heard of enlightenment, so took a peek but as far as I could make out from the docs, it is linux/unix project? I saw nothing about MacOS or Windows... did I miss it?

[Py]Qt of course is cross-platform with the local look/feel.

Re: Hello Qt for Python

#114
post #66

Very happy to hear this as the author of a PyQt-based file manager [1] and an open source library for solving the many headaches that come with developing desktop apps [2]. Once Qt for Python is stable enough, I'll be happy to switch to it from PyQt. [1]: https://fman.io [2]: https://github.com/mherrmann/fbs

What would you recommend to someone who wants to write Python desktop applications today? I've used wxWindows way back when, and I'd hate to use Electron. Would you go with Qt for Python, or PyQT? Also, what's PySide/PySide2?

Tkinter, it comes packed with python and is actually really good and really fast.

In fact, when I tried variations of Qt for py, I just quit out of frustration with how things either didn’t work or didn’t work very fast, now I just stick with Tkinter.

Re: Hello Qt for Python

#115
post #26

FWIW I use PyQt5 in a code editor project I maintain. While all GUI frameworks have hiccups and smells to various degrees, Qt and PyQt5 has been, relatively speaking, the strongest UI framework I've encountered for Python. Why? Ease of development, cross-platform reach, "batteries included" (e.g. accessibility features, important for my project), friendliness of the API and breadth of features immediately spring to m…

Sorry to be spamming here but check out my https://github.com/mherrmann/fbs . It is literally the solution to your pain point.

No, interesting and useful. But a few questions. So basically you have automated the job of calling PyInstaller to make a standalone app, plus the step of wrapping the app in an installer. Yes?

In order to use this, if I read the tutorial[1] code correctly, I must modify my app to wrap everything -- or at any rate, all PyQt-related things? -- inside an AppContext, and modify the outermost level to create this.

If so, this is easy enough for the tutorial but what if my app opens multiple windows and has code to create them spread over multiple modules (as one of mine does). Is there a simple way to get all these bits into one "context"? Or have I read too hastily?

[1] https://github.com/mherrmann/fbs-tutorial

Re: Hello Qt for Python

#116
post #71

Earlier quoted context omitted.

The Python standard library itself also breaks the PEP8 naming convention in all the ways PyQt does so their decision really makes sense. If Python itself were consistent the trade-off would be different... I find PyQt to be Pythonic in all the ways that count, e.g. replacing `self.setFoo(bar)` with `self.foo = bar`, decorators for signals/slots, etc.

It does? Which library?

logging for instance.

    import logging
    logger = logging.getLogger()
    logger.setLevel(logging.DEBUG)
    logger.addHandler(...)

Re: Hello Qt for Python

#117
post #25

Sadly, we still don't have the seamless UI building functionality Delphi had 15 years ago, allowing making a fairly advanced desktop app in a day. Jumping between Qt Designer and IDE back and forth is still an order of magnitude more complicated than it needs to be.

> Jumping between Qt Designer and IDE back and forth is still an order of magnitude more complicated than it needs to be. ... uh ? the designer is part of the ide... nowadays you even have a code view synced with the UI editor in realtime ( http://blog.qt.io/blog/2017/05/24/qt-quick-designer-qt-creat... )

He was talking about writing Qt apps with Python. (This entire post is about writing Qt apps with Python.) Qt Creator is not a Python IDE.

Re: Hello Qt for Python

#118
post #114
post #66

Earlier quoted context omitted.

What would you recommend to someone who wants to write Python desktop applications today? I've used wxWindows way back when, and I'd hate to use Electron. Would you go with Qt for Python, or PyQT? Also, what's PySide/PySide2?

Tkinter, it comes packed with python and is actually really good and really fast. In fact, when I tried variations of Qt for py, I just quit out of frustration with how things either didn’t work or didn’t work very fast, now I just stick with Tkinter.

Unfortunately, Tk isn't accessible with screen readers (for blind people) or other assistive technologies, at least on Windows. Of course, if you're just developing utilities for yourself, that's fine. Otherwise, I'd recommend wxWidgets or Qt instead.

Re: Hello Qt for Python

#119
post #26

FWIW I use PyQt5 in a code editor project I maintain. While all GUI frameworks have hiccups and smells to various degrees, Qt and PyQt5 has been, relatively speaking, the strongest UI framework I've encountered for Python. Why? Ease of development, cross-platform reach, "batteries included" (e.g. accessibility features, important for my project), friendliness of the API and breadth of features immediately spring to m…

Sorry to be spamming here but check out my https://github.com/mherrmann/fbs . It is literally the solution to your pain point.

Does it use Qt IFW? That's what I've been using for cross-platform installers.

Re: Hello Qt for Python

#120
post #43
post #37

Does anyone know of a Qt binding for Python that is actually pythonic (as in follows PEP 8)? Both PyQt and Pyside are just one-to-one wrappers that use C-style naming for everything. I find that really strange. The same holds for most other GUI libraries, like WxPython. It seems the only real pythonic GUI libraries are Tkinter and PyGobject.

Oh and Kivy of course!

Have you tried Kivy in production? Looks interesting but I haven't dug in.
Post reply on HN