1. yes, you  are rigth , clr.AddReference does not work ( there is not
method AddReference in clr.dll nor PythonRuntime.dll).

But you cant do this:

import clr
import System.Windows.Forms as WinForms
from System.Drawing import Size, Point
f=WinForms.Form()
f.Text = "Hello World From Python"
f.AutoScaleBaseSize = Size(5, 13)
f.ClientSize = Size(392, 117)
h = WinForms.SystemInformation.CaptionHeight
f.MinimumSize = Size(392, (117 + h))
f.dgv=WinForms.DataGridView()
f.dgv.Location = Point(2, 2)
button = WinForms.Button()
button.Location = Point(256, 64)
button.Text = "Click Me!"
f.Controls.Add(button)
f.Controls.Add(f.dgv)
WinForms.Application.Run(f)

#  import Config class  from  Nini.dll assembly

import Nini.Config as config
config= Config.XmlConfigSource("DbManager.xml")
print config.Configs["firebird2.0"].Get("providerName")
FirebirdSql.Data.FirebirdClient

# import class FirebirdMetaData  from Mono.Data.SqlSharp.DatabaseBrowser.dll

from Mono.Data.SqlSharp.DatabaseBrowser import FirebirdMetaData
me=FirebirdMetaData()
print me
Mono.Data.SqlSharp.DatabaseBrowser.FirebirdMetaData
me.ToString()
Mono.Data.SqlSharp.DatabaseBrowser.FirebirdMetaData



2. yes the old  CLR still works

from CLR.System.Reflection import Assembly
print Assembly
<class 'System.Reflection.Assembly'>

for samples checkout
http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/trunk/pythonnet/demo/



angel ignacio

2007/3/2, Jim Hargrave <[EMAIL PROTECTED]>:

I installed the Python.Net for 2.0 (pre-compiles binaries) from the link
below.  But I am unable to get this working:

>>> import clr  # this works
>>> clr.AddReference("System.Windows.Forms")
Traceback (most recent call last):
   File "<input>", line 1, in ?
AttributeError: AddReference

According to the readme file this is supposed to work and matches up
with the IronPython syntax. Am I doing something wrong?

I copied the Python.Net for 2.0 binaries over my Python 2.4 install
(overwriting my python.exe).

All sample Python.NET files worked fine - but they use the old "CLR"
syntax.

Jim


angel ignacio colmenares laguado wrote:
> for Python.NET support for .NET 2.0:
>
> 1. Download de latest source from
> http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/trunk/
>
>
> (you can use Tortoise SVN in win*)
>
> 2. change in  importhook.cs :
>
> line 25
> static *Clr*Module clr;   with        static *clr*Module clr;
>
>
> line 50
> clr = new *Clr*Module("clr");     with            clr = new
> *clr*Module();
>
> line 51
>
> Runtime.PyDict_SetItemString(dict, "clr", *clr*.pyHandle);
> with
> Runtime.PyDict_SetItemString
> (dict, "clr", *root*.pyHandle);
>
>
> line 111:
>
> Runtime.Incref(*clr*.pyHandle);
> with
> Runtime.Incref(*root*.pyHandle);
>
>
> line 112:
> return *clr*.pyHandle;
>
> with
> return *root*.pyHandle;
>
>
> 3. Change makefile with this:
>
>
> ILDASM=ildasm.exe
> ILASM=/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727/ilasm.exe
> CSC=/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727/csc.exe
>
>
> all: python.exe
>
> python.exe: Python.Runtime.dll
>       cd src; cd console; \
>
>       $(CSC) -nologo -target:exe -out:../../python.exe \
>         -reference:../../Python.Runtime.dll -recurse:*.cs
>       cd ..; cd ..;
>
>
>
> Python.Runtime.dll:clr.dll
>       cd src; cd runtime; \
>       $(CSC) -nologo -unsafe -target:library
-out:../../Python.Runtime.dll \
>
>        -reference:clr.dll \
> /       -recurse:*.cs
>       cd ..; cd ..;
>
>
> /clr.dll:
>       $(ILASM) -nologo -dll -quiet -output=clr.dll \
>       ./src/runtime/clrmodule.il;
>
>
>
> 4. using Mingw32 (msys) execute:
>
> makefile
>
>
> you get :Python.Runtime.dll, clr.dll and pyton.exe
>  ready for net 2.0
>
>
> 5. put Python.Runtime.dll and crl.dll in your python24 directory.
>
>
> 6. you can get ready binaries (Python.Runtime.dll
> , clr.dll and pyton.exe) for Net 2.0  from :
>
> http://angel.ignacio.colmenares.googlepages.com/pythonnet
>
> 7. Some screenshots in :
>
> http://angel.ignacio.colmenares.googlepages.com/pythonnet/
>  <http://angel.ignacio.colmenares.googlepages.com/pythonnet>/
>
>
> angel ignacio colmenares laguado
>
>
> ------------------------------------------------------------------------
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet@python.org
> http://mail.python.org/mailman/listinfo/pythondotnet

_________________________________________________
Python.NET mailing list - PythonDotNet@python.org
http://mail.python.org/mailman/listinfo/pythondotnet




--
Atentamente,

angel ignacio colmenares laguado
_________________________________________________
Python.NET mailing list - PythonDotNet@python.org
http://mail.python.org/mailman/listinfo/pythondotnet

Reply via email to