From Pierre.Zeeman at psitek.com Mon Sep 4 09:12:43 2006 From: Pierre.Zeeman at psitek.com (Pierre Zeeman) Date: Mon, 4 Sep 2006 09:12:43 +0200 Subject: [Python.NET] Newbie question: Howto include .NET DLL in Pythin code. Message-ID: >From the samples: import CLR.System.Windows.Forms as WinForms If you need to import your own, it's just CLR... I use py2exe a lot and found it necessary to add an "import CLR" statement as well, so: import CLR import CLR.System.Windows.Forms as WinForms would be my standard way of including Forms. Hth, Pierre -----Original Message----- From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of Caolan Sent: 31 August 2006 07:40 PM To: pythondotnet at python.org Subject: [Python.NET] Newbie question: Howto include .NET DLL in Pythin code. Hello, I am in need of including in some Python code the namespace and classes in a .NET C# DLL. Can anyone please give me a quick snippet that will demonstrate how to do this? Thanks! -Caolan O'Domhnaill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060904/f54b4f17/attachment.htm From caolan at ldmf.net Mon Sep 4 16:46:57 2006 From: caolan at ldmf.net (Caolan) Date: Mon, 4 Sep 2006 07:46:57 -0700 Subject: [Python.NET] Newbie question: Howto include .NET DLL in Pythincode. Message-ID: Thanks Pierre. I'll go ahead and work from there! -Caolan ________________________________ From: pythondotnet-bounces at python.org on behalf of Pierre Zeeman Sent: Mon 9/4/2006 12:12 AM To: pythondotnet at python.org Subject: Re: [Python.NET] Newbie question: Howto include .NET DLL in Pythincode. >From the samples: import CLR.System.Windows.Forms as WinForms If you need to import your own, it's just CLR... I use py2exe a lot and found it necessary to add an "import CLR" statement as well, so: import CLR import CLR.System.Windows.Forms as WinForms would be my standard way of including Forms. Hth, Pierre -----Original Message----- From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of Caolan Sent: 31 August 2006 07:40 PM To: pythondotnet at python.org Subject: [Python.NET] Newbie question: Howto include .NET DLL in Pythin code. Hello, I am in need of including in some Python code the namespace and classes in a .NET C# DLL. Can anyone please give me a quick snippet that will demonstrate how to do this? Thanks! -Caolan O'Domhnaill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060904/9d3c7d99/attachment.html From mkozyarchuk at funddevelopmentservices.com Wed Sep 6 23:10:28 2006 From: mkozyarchuk at funddevelopmentservices.com (Maksim Kozyarchuk) Date: Wed, 6 Sep 2006 17:10:28 -0400 Subject: [Python.NET] CrlModule could not be found error? Message-ID: <8674D71026D5C848831DB7CA34B1C75803D038@fds1wmail01.funddevelopmentservices.com> I am having the same issue, it seems that a module is missing from SVN. I was able to compile version 39. ________________________________ From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of chanh hua Sent: Thursday, August 31, 2006 12:03 PM To: pythondotnet at python.org Subject: [Python.NET] CrlModule could not be found error? while trying to build the subversion trunk for python.net using the makefile from cygwin, i get the error message below. I'm not having much luck finding this ClrModule. What am i doing wrong? thanks csc.exe /nologo /unsafe /target:library /out:../../Python.Runtime.dll \ /recurse:*.cs importhook.cs(25,9): error CS0246: The type or namespace name 'ClrModule' could not be found (are you missing a using directive or an assembly reference?) make: *** [Python.Runtime.dll] Error 1 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060906/a9a41fd4/attachment.htm From branan at gmail.com Sat Sep 16 00:42:34 2006 From: branan at gmail.com (Branan Riley) Date: Fri, 15 Sep 2006 15:42:34 -0700 Subject: [Python.NET] Python-enabled applications with PythonDotNet Message-ID: Some of you may have heard of Blender, a free modelling package. It has a python interface for scripts, and I'm working on an exporter to a file format that I have C# classes written for. The README isn't very clear on whether that works - applications that link to python for doing scripting. Does Py.NET for for that, and, if so, does anything special need to be done? I'm sorry if this is a question you've had before, but there isn't a lot of documentation yet for the program. My plan was to write a C++ module that could talk to both the Python code and the C# code - not a very fun thing to do. If this project can't do what I'd like, do you know of something that can? I'd rather not re-invent the wheel if I don't have to. From Schonlandy at hotmail.com Sun Sep 17 02:17:30 2006 From: Schonlandy at hotmail.com (Jen) Date: Sat, 16 Sep 2006 17:17:30 -0700 (PDT) Subject: [Python.NET] Can't Import PIL Image Message-ID: <6345332.post@talk.nabble.com> I have a py file using PIL to handle some image staff, and want to invoke its method in C# The py file works fine under Python or ActivePython (2.3), it looks sth like this: import Image, sys def convert(srcImg): im = Image.open(srcImg).convert("1").rotate(0) data = im.tostring("raw", "1;I") ... return "".join(strList) but when invoked in C# it comes with a Python.Runtime.PythonException I try to debug the problem, found out that def test(srcImg): return "some thing" works fine but def test(srcImg): im = Image.open(srcImg) not, so the problem is caused by unable to import Image have any solution? thx in advance -- View this message in context: http://www.nabble.com/Can%27t-Import-PIL-Image-tf2284201.html#a6345332 Sent from the Python - pythondotnet forum at Nabble.com. From brian.lloyd at revolution.com Mon Sep 18 15:39:22 2006 From: brian.lloyd at revolution.com (Brian Lloyd) Date: Mon, 18 Sep 2006 09:39:22 -0400 Subject: [Python.NET] Can't Import PIL Image In-Reply-To: <6345332.post@talk.nabble.com> Message-ID: Are you certain that you have installed PIL into the instance of Python that you are using with Python for .NET? This is easy to forget - if you are using the 'built-in' python install that comes with Python for .NET, it will *not* know about any packages you may have installed in a pre-existing Python install. -Brian On 9/16/06 8:17 PM, "Jen" wrote: > > I have a py file using PIL to handle some image staff, and want to invoke its > method in C# > The py file works fine under Python or ActivePython (2.3), it looks sth like > this: > > import Image, sys > def convert(srcImg): > im = Image.open(srcImg).convert("1").rotate(0) > data = im.tostring("raw", "1;I") > ... > return "".join(strList) > > but when invoked in C# it comes with a Python.Runtime.PythonException > I try to debug the problem, found out that > > def test(srcImg): > return "some thing" > > works fine > > but > > def test(srcImg): > im = Image.open(srcImg) > > not, > so the problem is caused by unable to import Image > have any solution? thx in advance From dvpdiner2 at yahoo.com Sun Sep 24 03:51:24 2006 From: dvpdiner2 at yahoo.com (Darryl Pogue) Date: Sat, 23 Sep 2006 18:51:24 -0700 (PDT) Subject: [Python.NET] Error when trying to import a C# DLL Message-ID: <20060924015124.56170.qmail@web31613.mail.mud.yahoo.com> I'm getting this error when ever I try to use Assembly.Load("Huru.Plasma.dll") I need to be able to access the dll's classes in order to translate data from one format to another. I get this output on the console: CLR.System.BadImageFormatException: Exception from HRESULT: 0x8013141D. at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark) at System.Reflection.Assembly.Load(Byte[] rawAssembly) ------------------------- I have tried using import CLR.Huru.Plasma but it tells me that there is no module named Huru. The dll is in the GAC. I am able to access all System dlls and DirectX dlls, but not my own C# dll. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060923/0f35fc1f/attachment.htm From mkozyarchuk at funddevelopmentservices.com Mon Sep 25 15:34:02 2006 From: mkozyarchuk at funddevelopmentservices.com (Maksim Kozyarchuk) Date: Mon, 25 Sep 2006 09:34:02 -0400 Subject: [Python.NET] Error when trying to import a C# DLL Message-ID: <8674D71026D5C848831DB7CA34B1C75803D056@fds1wmail01.funddevelopmentservices.com> Darryl, Does the issue only occur when you load the assembly from the CAG? I've typically used Assembly.LoadWithPartialName( 'NameOfMyAssembleyWithoutDotDLL' ) from CLR import MyClass with the DLL located in the PYTHONPATH. Maksim ________________________________ From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of Darryl Pogue Sent: Saturday, September 23, 2006 9:51 PM To: pythondotnet at python.org Subject: [Python.NET] Error when trying to import a C# DLL I'm getting this error when ever I try to use Assembly.Load("Huru.Plasma.dll") I need to be able to access the dll's classes in order to translate data from one format to another. I get this output on the console: CLR.System.BadImageFormatException: Exception from HRESULT: 0x8013141D. at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark) at System.Reflection.Assembly.Load(Byte[] rawAssembly) ------------------------- I have tried using import CLR.Huru.Plasma but it tells me that there is no module named Huru. The dll is in the GAC. I am able to access all System dlls and DirectX dlls, but not my own C# dll. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060925/a0ed218d/attachment.html