<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks so much, Phil! It works now. I never would have thought about<br>
the reason why it didn't work.<br>
<br>
Thanks a lot for looking into it!<br>
<br>
-Jean<br>
<br>
Phil Thompson wrote:
<blockquote cite="mid:169e9e83d178f5920b54c3d1b035d68d@localhost"
type="cite">
<pre wrap="">On Tue, 26 Oct 2010 12:46:28 -0700, Qin Shen <a class="moz-txt-link-rfc2396E" href="mailto:jeanshen@tippett.com"><jeanshen@tippett.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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?
</pre>
</blockquote>
<pre wrap=""><!---->
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
</pre>
</blockquote>
<br>
</body>
</html>