1. yes, you are rigth , clr.AddReference does not work ( there is not method AddReference in clr.dll nor PythonRuntime.dll). <br><br>But you cant do this:<br><br>>>>import clr<br>>>>import System.Windows.Forms
as WinForms<br>>>>from System.Drawing import Size, Point<br>>>>f=WinForms.Form()<br>>>>f.Text = "Hello World From Python"<br>>>>f.AutoScaleBaseSize = Size(5, 13)<br>>>>
f.ClientSize = Size(392, 117)<br>>>>h = WinForms.SystemInformation.CaptionHeight<br>>>>f.MinimumSize = Size(392, (117 + h))<br>>>>f.dgv=WinForms.DataGridView()<br>>>>f.dgv.Location = Point(2, 2)
<br>>>>button = WinForms.Button()<br>>>>button.Location = Point(256, 64)<br>>>>button.Text = "Click Me!"<br>>>>f.Controls.Add(button)<br>>>>f.Controls.Add(f.dgv)<br>>>>
WinForms.Application.Run(f)<br><br># import Config class from Nini.dll assembly<br><br>>>>import Nini.Config as config<br>>>>config= Config.XmlConfigSource("DbManager.xml")<br>>>>print
config.Configs["firebird2.0"].Get("providerName")<br>FirebirdSql.Data.FirebirdClient<br><br># import class FirebirdMetaData from Mono.Data.SqlSharp.DatabaseBrowser.dll<br><br>>>>from Mono.Data.SqlSharp.DatabaseBrowser
import FirebirdMetaData<br>>>>me=FirebirdMetaData()<br>>>>print me<br>Mono.Data.SqlSharp.DatabaseBrowser.FirebirdMetaData<br>>>>me.ToString()<br>Mono.Data.SqlSharp.DatabaseBrowser.FirebirdMetaData
<br><br><br><br>2. yes the old CLR still works<br><br>from CLR.System.Reflection import Assembly<br>print Assembly<br><class 'System.Reflection.Assembly'><br><br>for samples checkout <a href="http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/trunk/pythonnet/demo/">
http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/trunk/pythonnet/demo/</a><br><br><br><br>angel ignacio<br><br><div><span class="gmail_quote">2007/3/2, Jim Hargrave <<a href="mailto:jhargraveiii@comcast.net">jhargraveiii@comcast.net
</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I installed the Python.Net for 2.0 (pre-compiles binaries) from the link<br>
below. But I am unable to get this working:<br><br> >>> import clr # this works<br> >>> clr.AddReference("System.Windows.Forms")<br>Traceback (most recent call last):<br> File "<input>", line 1, in ?
<br>AttributeError: AddReference<br><br>According to the readme file this is supposed to work and matches up<br>with the IronPython syntax. Am I doing something wrong?<br><br>I copied the Python.Net for 2.0 binaries over my Python
2.4 install<br>(overwriting my python.exe).<br><br>All sample Python.NET files worked fine - but they use the old "CLR" syntax.<br><br>Jim<br><br><br>angel ignacio colmenares laguado wrote:<br>> for Python.NET
support for .NET 2.0:<br>><br>> 1. Download de latest source from<br>> <a href="http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/trunk/">http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/trunk/</a><br>>
<br>><br>> (you can use Tortoise SVN in win*)<br>><br>> 2. change in importhook.cs :<br>><br>> line 25<br>> static *Clr*Module clr; with static *clr*Module clr;<br>><br>><br>> line 50
<br>> clr = new *Clr*Module("clr"); with clr = new<br>> *clr*Module();<br>><br>> line 51<br>><br>> Runtime.PyDict_SetItemString(dict, "clr", *clr*.pyHandle);<br>> with
<br>> Runtime.PyDict_SetItemString<br>> (dict, "clr", *root*.pyHandle);<br>><br>><br>> line 111:<br>><br>> Runtime.Incref(*clr*.pyHandle);<br>> with<br>> Runtime.Incref(*root*.pyHandle);
<br>><br>><br>> line 112:<br>> return *clr*.pyHandle;<br>><br>> with<br>> return *root*.pyHandle;<br>><br>><br>> 3. Change makefile with this:<br>><br>><br>> ILDASM=ildasm.exe<br>> ILASM=/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727/ilasm.exe
<br>> CSC=/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727/csc.exe<br>><br>><br>> all: python.exe<br>><br>> python.exe: Python.Runtime.dll<br>> cd src; cd console; \<br>><br>> $(CSC) -nologo -target:exe -out:../../python.exe \
<br>> -reference:../../Python.Runtime.dll -recurse:*.cs<br>> cd ..; cd ..;<br>><br>><br>><br>> Python.Runtime.dll:clr.dll<br>> cd src; cd runtime; \<br>> $(CSC) -nologo -unsafe -target:library -out:../../Python.Runtime.dll \
<br>><br>> -reference:clr.dll \<br>> / -recurse:*.cs<br>> cd ..; cd ..;<br>><br>><br>> /clr.dll:<br>> $(ILASM) -nologo -dll -quiet -output=clr.dll \<br>> ./src/runtime/clrmodule.il;
<br>><br>><br>><br>> 4. using Mingw32 (msys) execute:<br>><br>> makefile<br>><br>><br>> you get :Python.Runtime.dll, clr.dll and pyton.exe<br>> ready for net 2.0<br>><br>><br>> 5. put
Python.Runtime.dll and crl.dll in your python24 directory.<br>><br>><br>> 6. you can get ready binaries (Python.Runtime.dll<br>> , clr.dll and pyton.exe) for Net 2.0 from :<br>><br>> <a href="http://angel.ignacio.colmenares.googlepages.com/pythonnet">
http://angel.ignacio.colmenares.googlepages.com/pythonnet</a><br>><br>> 7. Some screenshots in :<br>><br>> <a href="http://angel.ignacio.colmenares.googlepages.com/pythonnet/">http://angel.ignacio.colmenares.googlepages.com/pythonnet/
</a><br>> <<a href="http://angel.ignacio.colmenares.googlepages.com/pythonnet">http://angel.ignacio.colmenares.googlepages.com/pythonnet</a>>/<br>><br>><br>> angel ignacio colmenares laguado<br>><br>
><br>> ------------------------------------------------------------------------<br>><br>> _________________________________________________<br>> Python.NET mailing list - <a href="mailto:PythonDotNet@python.org">
PythonDotNet@python.org</a><br>> <a href="http://mail.python.org/mailman/listinfo/pythondotnet">http://mail.python.org/mailman/listinfo/pythondotnet</a><br><br>_________________________________________________<br>Python.NET
mailing list - <a href="mailto:PythonDotNet@python.org">PythonDotNet@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/pythondotnet">http://mail.python.org/mailman/listinfo/pythondotnet</a><br></blockquote>
</div><br><br clear="all"><br>-- <br>Atentamente,<br><br>angel ignacio colmenares laguado