Live data from Hacker News

Hello Qt for Python

blog.qt.io

71–80 of 176 posts

Re: Hello Qt for Python

#71

Earlier quoted context omitted.

It's so much better if it's one-to-one. You can use the same documentation. The same search terms. You don't have to translate back and forth in your head all the time. At the end of the day, PEP8 is just a convention and we're free to break with it where it makes sense. Imho, this is such a case.

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?

Re: Hello Qt for Python

#72
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?

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".

Re: Hello Qt for Python

#73
post #44
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.

I just took a look at delphi. What’s so unique about its ui builder?

Don't know if its UI builder is unique or not, but there are plenty of good things about it. Some bad, too.

Here is one post and a thread with many pros and con views about Delphi:

Delphi – why won't it die? (2013) (stevepeacocke.blogspot.com)

https://news.ycombinator.com/item?id=7613543

Re: Hello Qt for Python

#74
post #62

Earlier quoted context omitted.

You can just do `pip install PyQt5` now. That is possible without a virtual environment, but in practice I think you still want to use one: python3 -m venv venv && source venv/bin/activate && pip install PyQt5.

How well does that work on OSX? I’ve tried many times over many years, but never got a satisfactory working Python + Qt development environment working on the Mac.

conda install pyqt

Re: Hello Qt for Python

#75
post #52

Earlier quoted context omitted.

Agree with having a pythonic API. There are already examples in the "Hello Qt" which are easily solvable: app = QApplication([]) # should read instead: app = QApplication() where the empty list is the default argument. Also app.exec_() # should be instead app.exec() as it is also in the C++ API. These small things make the difference.

exec is a reserved keyword in Python. The _ is there because the code wouldn't "compile" otherwise.

[deleted]

Re: Hello Qt for Python

#76

Earlier quoted context omitted.

> It's so much better if it's one-to-one. You can use the same documentation. The same search terms. You don't have to translate back and forth in your head all the time. Those are things that make it better for the library maintainers, sure, but presenting (and documenting) an API that is idiomatic, both in structure and behavior, for the host language is better for library consumers, as it doesn't force them to con…

Parent was taking about PEP8, which is purely syntactic. I would argue that has very little to do with structure and behaviour. It's completely superficial.

Syntax is an element of structure. But, yes, I was going beyond the upthread comment.

Re: Hello Qt for Python

#77
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".

Thank you, that looks very interesting. I'm not sure if it's cross-platform, but I'll play with it a bit and see.

Re: Hello Qt for Python

#78
Is is possible to use QML in a PyQt/PySide2 app? Using QML for interface and Python for logic would make perfect sense. But every PyQt article and tutorial I see is about QtWidgets.

Re: Hello Qt for Python

#80

This seems to be the successor for PySide that supports Qt 5. The old PySide died some years ago and only PyQt was offering Qt 5 support. Due to some details PyQt was never officially supported by Qt. Is PySide2 now officially supported by Qt?

http://blog.qt.io/blog/2018/04/13/qt-for-python-is-coming-to...

"PySide2 – the bindings from Python to Qt – changes skin this spring. We have re-branded it as Qt for Python on a solution level, as we wanted the name to reflect the use of Qt in Python applications. Under the hood it is still PySide2 – just better."

Post reply on HN