4 ms·
Agree with having a pythonic API. There are already examples in the "Hello Qt" which are easily solvable: app = QApplication([]) # should read instead:
by ktpsns 9y ago
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.
- mherrmann 9y agoexec is a reserved keyword in Python. The _ is there because the code wouldn't "compile" otherwise.
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- sago 9y ago`exec` is a python built-in (in py3, it was a keyword in py2). Variables that would clash names with keywords / built-is are conventionally followed by an _, so `exec_` is expected. I agree on your first example.