When writing code using PyQt or PySide, sometimes the equivalent function is available in both Qt and Python (e.g., QDir.exists
in Qt vs os.path.exists
in Python). In these cases, is there an established practice for which language to use?
I am wondering if issues of speed, refactoring, etc. might be relevant to the decision.
Thanks.
As I understand, many of those Qt functions were put in for cross-platform compatibility, and others to integrate with Qt. However, Python already includes cross-platform functions, so I would favor Python ones when possible since they're
However, you may have to use Qt's functions since they integrate with Qt and/or they provide functionality that Python doesn't.
This has been discussed for other languages, e.g. C++: Qt: Qt classes vs. standard C++
Really, it depends on whether you want to write a Qt application or a Python application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With