[PyQt] Moving PyQt programs to Python 3

Phil Thompson phil at riverbankcomputing.com
Thu Jul 14 10:35:55 BST 2011


On Thu, 14 Jul 2011 19:28:46 +1000, Algis Kabaila <akabaila at pcug.org.au>
wrote:
> On Thu, 14 Jul 2011 06:28:48 PM Phil Thompson wrote:
>> On Thu, 14 Jul 2011 14:26:40 +1000, Algis Kabaila
<akabaila at pcug.org.au>
>> 
>> wrote:
>> > 1. How to tell which Python version a given PyQt is bound to?
>> 
>> sys.hexversion?
> 
> I don't think that answers the (reformatted) question.  From idle the 
> sys.hexversion does show some magic number
>>>> import sys
>>>> sys.hexversion
> 50462960

The docs tell you how to interpret it, try hex(sys.hexversion).

> But even if that number relates to the version of Python, it tells
nothing 
> about the version of Python at binding to PyQt. The programs that use
PyQt 
> depend on the version of Python as well as the versions of PyQt and Qt
> itself.  
> It would be helpful to be able to check those versions from PyQt alone. 

The major and minor version must match what's in sys.hexversion otherwise
the import would fail. The micro version is irrelevant.

Phil


More information about the PyQt mailing list