[PyQt] Platforms directive or tags, or both?

Jens Thoms Toerring jt at toerring.de
Fri Oct 19 10:15:01 BST 2012


i Phil,

On Fri, Oct 19, 2012 at 09:19:13AM +0100, Phil Thompson wrote:
> >> On my Mac (Py 2.7.1), I did this:
> >> 
> >> import ctypes
> >> ctypes.c_size_t == ctypes.c_ulong
> >> # returns True
> >> ctypes.c_size_t == ctypes.c_uint
> >> # returns False
> >> 
> >> So it looks like a variation on your script will work, since Python is
> >> already used as part of the CMake finds before generating the sip
> >> files for the bindings. CMake (or Python) can then be used to generate
> >> the sip file from the returned typedef string. Thanks again.
> > 
> > That looks like a brilliant idea since it avoids all the
> > potential problems with getting the test program to com-
> > pile! I never had a closer look at what can be done with
> > ctypes, so I missed that one. Do you mind if I steal that
> > idea of yours for my own project?
> 
> FYI, ctypes isn't supported on all platforms (HP-UX for example). This is
> a problem for many scientific and engineering users.

Thanks for pointing that out! So to be on the safe side one
probably should combine both methods - when ctypes is avai-
lable then use it, otherwise (on ImportError geting thrown)
revert back to writing out, compiling and running the small
C++ program...
                         Best regards, Jens
-- 
  \   Jens Thoms Toerring  ________      jt at toerring.de
   \_______________________________      http://toerring.de


More information about the PyQt mailing list