From tommyadam at freenet.de Thu Sep 2 11:15:20 2004 From: tommyadam at freenet.de (tommyadam@freenet.de) Date: Thu Sep 2 11:15:22 2004 Subject: [Python.NET] Embedding Python/Python.NET under C++ Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20040902/310a1b85/attachment.htm From carsten at muc-boesche.de Thu Sep 9 20:54:26 2004 From: carsten at muc-boesche.de (cb) Date: Thu Sep 9 20:40:34 2004 Subject: [Python.NET] PythonNet does not work with my Zope Message-ID: <4140A6E2.20102@muc-boesche.de> Hi, I tried to work with the Net connection in Zope. (Zope 2.7.2-0, python 2.3.3, win32) I copied the files CLR.dll, Python.Runtime.dll and Python.Runtime.key to F:\Programme\Zope-2.7.2-0\bin (where Python.exe is) Starting Zope as a program and than executing a Python function with the following code >>> snip ------------------------------------------- import CLR from CLR import System System.Console.WriteLine("oktest") print "durch" >>>snip ------------------------------------------- prints "oktest" on the console and then the program hangs. PythonNet-1.0-beta3 works fine on my computer. What's wrong? Thanks Carsten From david.powell at kcl.ac.uk Fri Sep 17 15:30:54 2004 From: david.powell at kcl.ac.uk (david Powell) Date: Fri Sep 17 15:31:06 2004 Subject: [Python.NET] Procedure for building Python.Runtime.dll Message-ID: <20040917133105.BC40D1E4002@bag.python.org> I was hoping to experiment with modifications to component files in the runtime. Most just making some things public. I cannot get nmake to work with the makefile in \PythonNet-1.0-beta3\src This is on both XP and 2k machines. The nmake comes with Visual studio and on my system is found in c:\program files\microsoft visual studio .NET 2003\sdk\v1.1\bin Any thoughts? Regards David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20040917/b1ad8be5/attachment.html From thane at magna-capital.com Fri Sep 17 21:51:46 2004 From: thane at magna-capital.com (Thane) Date: Fri Sep 17 21:51:57 2004 Subject: [Python.NET] Procedure for building Python.Runtime.dll In-Reply-To: <20040917133105.BC40D1E4002@bag.python.org> Message-ID: I had the same problem - actually there were two problems. First the Python.Runtime.key file from my cvs download didn't work; I used the file from the binary install. Second, the makefile is not understood by MS DevStudio, so I went through the makefile and built it "by hand." In other words, I just manually built all the modules as specified in the makefile. Alternatively, you could create a new MS DevStudio project and build it that way. _____ From: pythondotnet-bounces@python.org [mailto:pythondotnet-bounces@python.org] On Behalf Of david Powell Sent: Friday, September 17, 2004 6:31 AM To: PythondotNet Subject: [Python.NET] Procedure for building Python.Runtime.dll I was hoping to experiment with modifications to component files in the runtime. Most just making some things public. I cannot get nmake to work with the makefile in \PythonNet-1.0-beta3\src This is on both XP and 2k machines. The nmake comes with Visual studio and on my system is found in c:\program files\microsoft visual studio .NET 2003\sdk\v1.1\bin Any thoughts? Regards David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20040917/87577f77/attachment.html From thane at magna-capital.com Fri Sep 24 23:21:25 2004 From: thane at magna-capital.com (thane@magna-capital.com) Date: Fri Sep 24 23:21:33 2004 Subject: [Python.NET] .NET backend working Message-ID: I've got an alpha version of a .NET backend up and running for matplotlib (http://matplotlib.sourceforge.net/ ). It was just intended to be "proof-of-concept" code, but it works. This back end is targeted for anyone using PythonNet (see http://www.zope.org/Members/Brian/PythonNet/index_html ). It should also be compatible with IronPython (see http://ironpython.com/) once the standard libraries and Numarray (or Numeric) are available for the IronPython release. If there is any interest, please respond to this post and I'll go through the trouble of adding it to the project (at this point I don't know how to do this, so any guidance here would be appreciated). --Thane Thane Plummer, Ph.D. CEO Magna Capital, LLC (520) 760-4957 (520) 405-2277 (cell) thane@magna-capital.com www.magna-capital.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20040924/b85c3fdc/attachment.html From thane at magna-capital.com Sat Sep 25 04:04:03 2004 From: thane at magna-capital.com (thane@magna-capital.com) Date: Sat Sep 25 04:04:12 2004 Subject: [Python.NET] Uses PythonNet with current Python installation Message-ID: I'm not sure why, but copying the PythonNet DLLs (CLR.dll and Python.Runtime.dll) to a standard CPython installation directory, does not give the CPython "real" access to the CLR. Two observations: 1. The CLR modules don't load on the first try (see output below), and 2. Running modules that require the CLR will sometimes fail (I'll investigate this some more). I've written a .Net backend for matplotlib, which runs fine with the Python distribution from PythonNet (Brian's distribution), but it crashes when the DLLs are in the CPython distribution from Python.org. I'm stumped. could it be related to the "loading delay" above? Any ideas? --- Output from CPython with PythonNet DLLs in the directory -------- C:\Python\Python2.3.3>python Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.system('dir *.dll') Volume in drive C has no label. Volume Serial Number is 7CEC-BD8B Directory of C:\Python\Python2.3.3 09/08/2004 09:48 PM 2,560 CLR.dll 09/08/2004 09:47 PM 98,304 Python.Runtime.dll 12/18/2003 08:22 PM 974,915 python23.dll 3 File(s) 1,075,779 bytes 0 Dir(s) 13,137,387,520 bytes free 0 >>> from CLR.System import String getattr: proxy getattr: dict getattr: __path__ Traceback (most recent call last): File "", line 1, in ? ImportError: No module named System >>> from CLR.System import String >>> mystr = String('fubar') >>> mystr >>> Thane Plummer, Ph.D. CEO Magna Capital, LLC (520) 760-4957 (520) 405-2277 (cell) thane@magna-capital.com www.magna-capital.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20040924/105fc889/attachment.htm From niki at vintech.bg Sat Sep 25 15:31:10 2004 From: niki at vintech.bg (Niki Spahiev) Date: Sat Sep 25 15:31:21 2004 Subject: [Python.NET] Uses PythonNet with current Python installation In-Reply-To: References: Message-ID: <4155731E.2070409@vintech.bg> thane@magna-capital.com wrote: > I?m not sure why, but copying the PythonNet DLLs (CLR.dll and > Python.Runtime.dll) to a standard CPython installation directory, does > not give the CPython ?real? access to the CLR. > > > > Two observations: > > 1. The CLR modules don?t load on the first try (see output below), and > > 2. Running modules that require the CLR will sometimes fail (I?ll > investigate this some more). I?ve written a .Net backend for > matplotlib, which runs fine with the Python distribution from PythonNet > (Brian?s distribution), but it crashes when the DLLs are in the CPython > distribution from Python.org. I?m stumped? could it be related to the > ?loading delay? above? > > > > Any ideas? IIRC one (and only one) of them should be in DLLs directory. HTH Niki Spahiev From jdhunter at ace.bsd.uchicago.edu Sat Sep 25 00:06:26 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Mon Sep 27 17:10:43 2004 Subject: [Python.NET] Re: [matplotlib-devel] .NET backend working In-Reply-To: ('s message of "Fri, 24 Sep 2004 14:21:25 -0700") References: Message-ID: >>>>> "thane" == writes: thane> I've got an alpha version of a .NET backend up and running thane> for matplotlib (http://matplotlib.sourceforge.net/ ). It thane> was just intended to be "proof-of-concept" code, but it thane> works. I'm certainly interested. I don't know a lot about .Net. Is your backend an image backend or GUI one? If the latter, are you using agg for rendering ala tkagg, gtkagg, etc, or native .Net drawing? Inquiring minds want to know. thane> This back end is targeted for anyone using PythonNet (see thane> http://www.zope.org/Members/Brian/PythonNet/index_html ). thane> It should also be compatible with IronPython (see thane> http://ironpython.com/) once the standard libraries and thane> Numarray (or Numeric) are available for the IronPython thane> release. thane> If there is any interest, please respond to this post and thane> I'll go through the trouble of adding it to the project (at thane> this point I don't know how to do this, so any guidance thane> here would be appreciated). The standard procedure for submitting a backend is to send it to the dev list, where I and other matplotlib developers can take it for a test drive and submit feedback. I'd be happy to give it a try. If you have any extra instructions for .Net dummies, please send them along with the code. Cheers! JDH thane> --Thane thane> Thane Plummer, Ph.D. thane> CEO Magna Capital, LLC thane> (520) 760-4957 thane> (520) 405-2277 (cell) thane> thane@magna-capital.com thane> www.magna-capital.com From f.kintzel at internet-access.de Mon Sep 27 10:19:59 2004 From: f.kintzel at internet-access.de (f.kintzel) Date: Tue Sep 28 10:20:19 2004 Subject: [Python.NET] import String : Uses PythonNet with current Python installation In-Reply-To: References: Message-ID: <4157CD2F.5010501@internet-access.de> Hello, I'm not shure why, but importing CLR-modules requires that the top-module is imported first, then submodules of it. Try the following : import CLR import CLR.System from CLR.System import String as CLRString foo = CLRString('bar') print foo -- I guess that the first time you import String only CLR or CLR.System is actually imported. Kind regards, Florian Kintzel thane@magna-capital.com wrote: > I'm not sure why, but copying the PythonNet DLLs (CLR.dll and > Python.Runtime.dll) to a standard CPython installation directory, does > not give the CPython "real" access to the CLR. > > > > Two observations: > > 1. The CLR modules don't load on the first try (see output > below), and > > 2. Running modules that require the CLR will sometimes fail > (I'll investigate this some more). I've written a .Net backend for > matplotlib, which runs fine with the Python distribution from > PythonNet (Brian's distribution), but it crashes when the DLLs are in > the CPython distribution from Python.org. I'm stumped... could it be > related to the "loading delay" above? > > > > Any ideas? > > > > --- Output from CPython with PythonNet DLLs in the directory -------- > > > > C:\Python\Python2.3.3>python > > Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] > on win32 > > Type "help", "copyright", "credits" or "license" for more information. > >>>> import os > >>>> os.system('dir *.dll') > > Volume in drive C has no label. > > Volume Serial Number is 7CEC-BD8B > > > > Directory of C:\Python\Python2.3.3 > > > > 09/08/2004 09:48 PM 2,560 CLR.dll > > 09/08/2004 09:47 PM 98,304 Python.Runtime.dll > > 12/18/2003 08:22 PM 974,915 python23.dll > > 3 File(s) 1,075,779 bytes > > 0 Dir(s) 13,137,387,520 bytes free > > 0 > >>>> from CLR.System import String > > getattr: proxy > > getattr: dict > > getattr: __path__ > > Traceback (most recent call last): > > File "", line 1, in ? > > ImportError: No module named System > >>>> from CLR.System import String > >>>> mystr = String('fubar') > >>>> mystr > > > >>>> > > > > Thane Plummer, Ph.D. > > CEO Magna Capital, LLC > > (520) 760-4957 > > (520) 405-2277 (cell) > > thane@magna-capital.com > > www.magna-capital.com > > > > > >------------------------------------------------------------------------ > >_________________________________________________ >Python.NET mailing list - PythonDotNet@python.org >http://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20040927/1656e72d/attachment.html From bruce_dodson at hotmail.com Wed Sep 29 01:42:17 2004 From: bruce_dodson at hotmail.com (Bruce Dodson) Date: Wed Sep 29 01:43:06 2004 Subject: [Python.NET] import String : Uses PythonNet with current Pythoninstallation References: <4157CD2F.5010501@internet-access.de> Message-ID: It's a bootstrapping problem. The CLR module not only defines the namespace for .NET packages, but also registers the import hook for those packages. So, without the "import CLR", the subpackage name cannot be found at the time when the first name lookup occurs. The import hook can, and probably should be written in Python, to avoid the bootstrapping problem. It would delegate to C# for CLR package references. Bruce ----- "f.kintzel" wrote in message news:4157CD2F.5010501@internet-access.de... Hello, I'm not shure why, but importing CLR-modules requires that the top-module is imported first, then submodules of it. Try the following : import CLR import CLR.System from CLR.System import String as CLRString foo = CLRString('bar') print foo