[PyQt] problem with importing a SIP module

Qin Shen jeanshen at tippett.com
Fri Oct 29 18:40:24 BST 2010


Thanks so much, Phil! It works now. I never would have thought about
the reason why it didn't work.

Thanks a lot for looking into it!

-Jean

Phil Thompson wrote:
> On Tue, 26 Oct 2010 12:46:28 -0700, Qin Shen <jeanshen at tippett.com> wrote:
>   
>> Hi Phil,
>>
>> It looks like the problem I'm having is caused by the namespace.
>> After removing the namespace, %Import works just fine. But We do
>> need to keep the namespace in our project. What do I need to do
>> to make it work?
>>     
>
> It is working...
>
> SIP implements a C++ namespace as a single Python class - in this case
> A.SG.
>
> It does not implement it as a separate class in each module. In other
> words, in this case, it does not implement it as A.SG and B.SG.
>
> When the B module is imported the contents of the SG namespace that it
> implements are added to the SG class in the A module.
>
> Your testB.py will work if you replace...
>
> from B import *
>
> ...to...
>
> import B
> from A import SG
>
> (Actually it doesn't matter what the order of these two lines are.)
>
> I admit that all this isn't very obvious, and I might not do it this way
> if I was doing it today.
>
> Phil
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101029/96cd9153/attachment.html>


More information about the PyQt mailing list