[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] import sip module with C++ namespace
From:       Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date:       2006-05-25 7:54:52
Message-ID: 200605250854.52312.phil () riverbankcomputing ! co ! uk
[Download RAW message or body]

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

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic