On Fri, Mar 5, 2010 at 5:40 AM, Frédéric
<[email protected]> wrote:
> Hello,
>
> As PySide is now working fine on debian sid (at least, it covers my needs),
> I'm about to modify my code to give priority to PySide, and fallback to
> PyQt if PySide is not available (my app runs on different platforms where
> PySide is not yet ported and/or packaged).
>
> How would you do the import statements to achieve that? What is the best
> method?
use try/except, e.g.:
try:
from PySide import QtCore, QtGui
except ImportError:
from PyQt4 import QtCore, QtGui
app = QtGui.QApplication(sys.argv)
....
But be sure to pay attention to the different licensing of the two
bindings. PySide is LGPL (i.e. same license as Qt itself), PyQt4 is
dual-licensed GPL/commercial.
If in doubt, read the licensing of both projects to make sure your
application conforms to both.
PS: I Am Not a Lawyer.
Regards,
--
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside