<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.3790.2577" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: SimSun;
}
@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: @SimSun;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue bgColor=white>
<DIV dir=ltr align=left><SPAN class=002093916-04012006><FONT face=Verdana 
color=#800000 size=2>You are correct. Actually, you are hitting the same problem 
that Steven Drucker reported yesterday. If the class is top-level (in the global 
namespace), IronPython won't import it. The simple workaround is to enclose the 
class in the namespace and then import</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=002093916-04012006><FONT face=Verdana 
color=#800000 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=002093916-04012006><FONT face=Verdana 
color=#800000 size=2>from namespace import class</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=002093916-04012006><FONT face=Verdana 
color=#800000 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=002093916-04012006><FONT face=Verdana 
color=#800000 size=2>I hope this helps. This is a bug that we introduced in Beta 
1 and will fix it in the next release.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=002093916-04012006><FONT face=Verdana 
color=#800000 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=002093916-04012006><FONT face=Verdana 
color=#800000 size=2>Martin</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> users-bounces@lists.ironpython.com 
[mailto:users-bounces@lists.ironpython.com] <B>On Behalf Of </B>Catalin 
Lungu<BR><B>Sent:</B> Tuesday, January 03, 2006 11:22 PM<BR><B>To:</B> 
Discussion of IronPython<BR><B>Subject:</B> Re: [IronPython] IP Tutorial 
Error<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>Ok, you have right. In clr.Reference I found 
"csextend", but when I&nbsp;import "import Simple" the console 
return:</FONT></DIV>
<DIV><FONT face=Arial size=2>Trackback (most recent call last):</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; File, line 0, in imput 
##1</FONT></DIV>
<DIV><FONT face=Arial size=2>Import Error: No module named Simple</FONT></DIV>
<DIV><FONT face=Arial size=2>I am sure that the name of the C class is 
Simple.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Catalin</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=haiboluo@exchange.microsoft.com 
  href="mailto:haiboluo@exchange.microsoft.com">Haibo Luo</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=users@lists.ironpython.com 
  href="mailto:users@lists.ironpython.com">Discussion of IronPython</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, January 03, 2006 7:26 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [IronPython] IP Tutorial 
  Error</DIV>
  <DIV><BR></DIV>
  <DIV class=Section1>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">clr.AddReferenceToFile returns 
  void, so &#8220;print a gets None&#8221; is expected.<o:p></o:p></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">clr.References could be what you 
  are looking for.<FONT color=navy><SPAN 
  style="COLOR: navy"><o:p></o:p></SPAN></FONT></SPAN></FONT></P>
  <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <DIV>
  <DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT 
  face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
  <HR tabIndex=-1 align=center width="100%" SIZE=2>
  </SPAN></FONT></DIV>
  <P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN 
  style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT 
  face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> <A 
  href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</A> 
  [mailto:users-bounces@lists.ironpython.com] <B><SPAN 
  style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Catalin Lungu<BR><B><SPAN 
  style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, January 03, 2006 7:58 
  AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Discussion of 
  IronPython<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> 
  [IronPython] IP Tutorial Error</SPAN></FONT><o:p></o:p></P></DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></P>
  <DIV>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hello,<BR>I compiled the folowing 
  class with "csc" to csextend.dll</SPAN></FONT><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">using System;<BR>using 
  System.Collections;</SPAN></FONT><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">public class 
  Simple<BR>{<BR>&nbsp;private int data;<BR>&nbsp;public Simple(int 
  data)<BR>&nbsp;{<BR>&nbsp;&nbsp;this.data = data;<BR>&nbsp;}<BR>&nbsp;public 
  override string ToString()<BR>&nbsp;{<BR>&nbsp;&nbsp;return 
  String.Format("Simple&lt;{0}&gt;", 
  data);<BR>&nbsp;}<BR>}</SPAN></FONT><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">When I try to use the 
  "csextend.dll" module the&nbsp;return variable is null.<BR>&gt;&gt;import 
  clr<BR>&gt;&gt;a=clr.AddReferenceToFile("csextend.dll")<BR>&gt;&gt;print 
  a<BR>None<BR>By the way I have tried with another .cs module and I receive the 
  same result.</SPAN></FONT><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I use VS2005 Professional and 
  IronPython 1.0 - Beta1</SPAN></FONT><o:p></o:p></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN 
  style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P></DIV>
  <DIV>
  <P class=MsoNormal><FONT face=Arial size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Any 
  ideea?<BR>Catalin</SPAN></FONT><o:p></o:p></P></DIV></DIV>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>users mailing 
  list<BR>users@lists.ironpython.com<BR>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com<BR></BLOCKQUOTE></BODY></HTML>