[Python.NET] PythonDotNet Digest, Vol 41, Issue 1

Philippe C. Martin pmartin at snakecard.com
Fri Mar 2 09:19:24 CET 2007


1) do what you want
2) stick to your word
3) let him breathe
4) keep me out of this



On Friday 2 March 2007 12:00, pythondotnet-request at python.org wrote:
> Send PythonDotNet mailing list submissions to
> 	pythondotnet at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mail.python.org/mailman/listinfo/pythondotnet
> or, via email, send a message with subject or body 'help' to
> 	pythondotnet-request at python.org
>
> You can reach the person managing the list at
> 	pythondotnet-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PythonDotNet digest..."
>
>
> Today's Topics:
>
>    1. Re: Using Third Party C# Libraries (Jim Hargrave)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 01 Mar 2007 23:32:44 -0700
> From: Jim Hargrave <jhargraveiii at comcast.net>
> Subject: Re: [Python.NET] Using Third Party C# Libraries
> To: pythondotnet at python.org
> Message-ID: <es8ged$jt3$1 at sea.gmane.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> 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 at python.org
> > http://mail.python.org/mailman/listinfo/pythondotnet
>
> ------------------------------
>
> _______________________________________________
> PythonDotNet mailing list
> PythonDotNet at python.org
> http://mail.python.org/mailman/listinfo/pythondotnet
>
>
> End of PythonDotNet Digest, Vol 41, Issue 1
> *******************************************

-- 
_________________________
Philippe C. Martin
+1 405 562 7005
www.snakecard.com
_________________________



More information about the PythonDotNet mailing list