Issue
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.
Solution
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
- More familiar to Python programmers
- Doesn't make you so dependent on Qt
- Fits in with Python's idioms
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.
Answered By - li.davidm
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.