I think you might have to set your module your of your PythonEngine to &quot;__main__&quot;. For example:<br><br>PythonEngine myPyEngine = new PythonEngine(someEngineOptions);<br>EngineModule mainModule = myPyEngine.CreateModule
(&quot;__main__&quot;, someVariables, true);<br><br>myPyEngine.ExecuteFile(someScriptFile, mainModule);<br><br>There are some extra there such as the &quot;someVariables&quot; but hopefully that might get you going in the right direction.
<br><br>HTH<br><br>Eric<br><br><div><span class="gmail_quote">On 9/15/06, <b class="gmail_sendername">Michael Welch</b> &lt;<a href="mailto:michaelgwelch@gmail.com">michaelgwelch@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I'm running IPython 1.0 on mono on Linux. I'm importing the gtk-sharp<br>dll and I want to subclass the Gtk.Widget class<br>(<a href="http://www.go-mono.com/docs/monodoc.ashx?tlink=5@ecma%3a1361%23Widget%2f">
http://www.go-mono.com/docs/monodoc.ashx?tlink=5@ecma%3a1361%23Widget%2f</a>).<br><br>Here is my script:<br><br>clr.AddReference(&quot;gtk-sharp&quot;)<br>clr.AddReference(&quot;gnome-sharp&quot;)<br>from Gtk import *<br>
from Gnome import *<br><br>Application.Init()<br><br>class Table:<br> pass<br>class Sheet(Widget):<br> def __init__(self, table):<br>&nbsp;&nbsp; Widget.__init__(self)<br><br>Here is my ipy session where I try to use Sheet<br><br>IronPython 
1.0.2432 on .NET 2.0.50727.42<br>Copyright (c) Microsoft Corporation. All rights reserved.<br>&gt;&gt;&gt; import sheet<br>&gt;&gt;&gt; from sheet import *<br>&gt;&gt;&gt; t = Table()<br>&gt;&gt;&gt; s = Sheet(t)<br>Traceback (most recent call last):
<br>TypeError: no overloads of Sheet could match (type, Table)<br>&nbsp;&nbsp;Sheet(type, IntPtr)<br>&nbsp;&nbsp;Sheet(type, GType)<br><br>&gt;&gt;&gt;<br><br>It tells me it can't find an appropriate overload for Sheet and then<br>gives me what looks like the only two possible candidates. However,
<br>the candidates it lists looks like they are from the parent class<br>Widget. Does IronPython hava a constraint that the __init__ method<br>must take the same parameters as the parent class? Here is the list of<br>constructors for Widget:
<br><a href="http://www.go-mono.com/docs/monodoc.ashx?tlink=5@ecma%3a1361%23Widget%2fC">http://www.go-mono.com/docs/monodoc.ashx?tlink=5@ecma%3a1361%23Widget%2fC</a><br><br>If I remove the parameter from __init__ it works. I've tested this
<br>scenario with made up classes and it works. CPython documentation<br>seems to indicate that a child class can have different parameters on<br>its __init__method then the parent class. Any help? Is there something<br>wrong with the gt-sharp library (I don't think so, as I could write a
<br>C# app that did this same thing and it worked).<br><br>I'm convinced this must be user-error and I'm just not seeing the problem<br><br>Thanks,<br>Michael<br>_______________________________________________<br>users mailing list
<br><a href="mailto:users@lists.ironpython.com">users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</blockquote></div><br>