[PyKDE] import sip module with C++ namespace

Phil Thompson phil at riverbankcomputing.co.uk
Thu May 25 08:54:52 BST 2006


On Thursday 25 May 2006 1:59 am, Zilin Du wrote:
> hi, I have an question about import SIP module with C++ namespace:
>
> for example, I wrote the following sip file:
>
> %module Word
> namespace N1 {
>    namespace N2 {
>       class A {
>         ...
>       };
>    };
> };
>
> after built up, if I  import as:
>
> import Word
>
> then i can use
>
> x = Word.N1.N2.A()
>
> Is there a better way I can use A directly like this ?
>
> from Word.N1.N2 import *

Namespaces are implemented as Python classes, so no.

Phil




More information about the PyQt mailing list