From guy at r-e-d.co.nz Fri Mar 3 21:21:18 2006 From: guy at r-e-d.co.nz (Guy Robinson) Date: Sat, 04 Mar 2006 09:21:18 +1300 Subject: [Python.NET] .NET2.0 and loading assemblies Message-ID: <4408A53E.3070104@r-e-d.co.nz> Hello, I've been forced (due to the host application) to move my code to NET2.0. I also need to use the host python installation like Tom. And like Tom I'm not a professional programmer but I'm wondering if we should standardise on the Ironpython syntax for loading assemblies. That is: import clr clr.AddReferenceByPartialName("System.Windows.Forms") clr.AddReferenceByPartialName("System.Drawing") clr.AddReferenceByPartialName("IronPython") from System.Drawing import Size from System.Windows.Forms import Form, Application etc What do you think? Regards, Guy ps: I too see python for .NET as the way forward. I hope Brian still feels the same. From brian.d.lloyd at gmail.com Mon Mar 13 17:46:50 2006 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Mon, 13 Mar 2006 11:46:50 -0500 Subject: [Python.NET] Python for .NET now at sourceforge Message-ID: <1c0b4a390603130846t7632e13dtae077762ea694ea0@mail.gmail.com> Hi all - Sorry for not being as responsive as I should lately -- I've recently changed companies so things have been a little hectic and I also had to make sure the 'paperwork was in order' re: open source projects, etc. Now that things have settled down a bit, I have been able to spend a little time moving pythonnet development over to sourceforge. I hope that this will make it easier for others to contribute and remove me as the main bottleneck ;^) The new Python for .NET homepage is now: http://pythonnet.sourceforge.net The SF project homepage is at: http://sourceforge.net/projects/pythonnet I've imported the current code into CVS. What I'd like to do this week is make a pythonnet-1_0-branch for continuing .NET 1.x compatible work, and open the trunk for .NET 2.x compatible work such as Michael has been doing. My new emails are brian.d.lloyd at gmail.com and brian.lloyd at revolution.com, if you're interested in participating or otherwise want to reach me directly. -Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060313/bda5db39/attachment.htm From roman.yakovenko at gmail.com Mon Mar 13 18:04:51 2006 From: roman.yakovenko at gmail.com (Roman Yakovenko) Date: Mon, 13 Mar 2006 19:04:51 +0200 Subject: [Python.NET] Python for .NET now at sourceforge In-Reply-To: <1c0b4a390603130846t7632e13dtae077762ea694ea0@mail.gmail.com> References: <1c0b4a390603130846t7632e13dtae077762ea694ea0@mail.gmail.com> Message-ID: <7465b6170603130904p628308faoe47e58f2aca2fb06@mail.gmail.com> > Hi all - > > Sorry for not being as responsive as I should lately -- I've recently > changed > companies so things have been a little hectic and I also had to make sure > the 'paperwork was in order' re: open source projects, etc. > > Now that things have settled down a bit, I have been able to spend a little > time moving pythonnet development over to sourceforge. I hope that this > will make it easier for others to contribute and remove me as the main > bottleneck ;^) > > The new Python for .NET homepage is now: > > http://pythonnet.sourceforge.net > > The SF project homepage is at: > > http://sourceforge.net/projects/pythonnet > > I've imported the current code into CVS. What I'd like to do this week is > make a pythonnet-1_0-branch for continuing .NET 1.x compatible work, > and open the trunk for .NET 2.x compatible work such as Michael has > been doing. Those are good news. I always knew that Python.NET is the way to go :-). > My new emails are brian.d.lloyd at gmail.com and brian.lloyd at revolution.com , > if you're interested in participating or otherwise want to reach me > directly. Also, I can not contribute source code I can do some testing for .NET 1.x branch ( and may be in future for 2.x ). I have something like 370 unittest written in Python.NET that tests client-server application. ( And the number will grow :-) ). > -Brian Thanks for Python.NET. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ From roman.yakovenko at gmail.com Mon Mar 13 20:56:03 2006 From: roman.yakovenko at gmail.com (Roman Yakovenko) Date: Mon, 13 Mar 2006 21:56:03 +0200 Subject: [Python.NET] Hi Brain In-Reply-To: <6AD9F6A5F6E096408F0B703773355A07A6007D@CHN-SNR-MBX01.wipro.com> References: <6AD9F6A5F6E096408F0B703773355A07A6007D@CHN-SNR-MBX01.wipro.com> Message-ID: <7465b6170603131156i1b88eedaxadcea09df61c7d09@mail.gmail.com> On 2/10/06, ranish.pullanat at wipro.com wrote: > Hi Brain, > > I am Ranish form India, doing as a programmer. Please read next article: http://www.catb.org/~esr/faqs/smart-questions.html > Can I use a .NET generated dll (Regular dll ) directly form Python (Not python .NET) ? What do you mean regular dll? > I am using calldll module, and getting a message as DLL loading failed (for my dll) > But when I tried to load kernal32.dll, its scusses. Why ? [ I called my dll form C++ its working finely ] > Do I need to register my dll in system ? It seems that you can not load your dll because of dependency problems. Check them with dependency walker tool > > > Please help me in explain the reason, for this. > Thanks for your time. > > Thanks & Regards > P.Ranish > Does this help? -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ From guy at r-e-d.co.nz Wed Mar 15 01:19:14 2006 From: guy at r-e-d.co.nz (Guy Robinson) Date: Wed, 15 Mar 2006 13:19:14 +1300 Subject: [Python.NET] form designer Message-ID: <44175D82.4030902@r-e-d.co.nz> Might be a tip for some. I've been using SharpDevelop for the visual layout of forms. Just create a boo form, go to the form code and copy paste the code into your python.net script. Works a treat. Guy From chatting.chatting at gmail.com Fri Mar 17 08:42:25 2006 From: chatting.chatting at gmail.com (chatting chatting) Date: Fri, 17 Mar 2006 13:12:25 +0530 Subject: [Python.NET] reg editor Message-ID: Hi what editor is used for IronPython. pelase help me bye regs Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060317/9921a4b3/attachment.htm From roman.yakovenko at gmail.com Fri Mar 17 19:22:03 2006 From: roman.yakovenko at gmail.com (Roman Yakovenko) Date: Fri, 17 Mar 2006 20:22:03 +0200 Subject: [Python.NET] reg editor In-Reply-To: References: Message-ID: <7465b6170603171022s7f796096k9fd270803e8f6737@mail.gmail.com> On 3/17/06, chatting chatting wrote: > > Hi > what editor is used for IronPython. The good one :-) > pelase help me > > bye > regs > Babu > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > > -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ From mark at walkereconomics.com Tue Mar 21 19:03:26 2006 From: mark at walkereconomics.com (Mark Anderson) Date: Tue, 21 Mar 2006 13:03:26 -0500 Subject: [Python.NET] Delegates and Dictionaries Message-ID: <44203FEE.5010700@walkereconomics.com> Hi all, I'm using .NET to implement a UI for some python code, and am updating various UI components using a .NET function. The .NET based UI calls the python based back end with an argument set which includes a delegate to the .NET UI update function. The python code then periodically invokes the delegate (passing it "a bunch of updated information") which is then used to update the UI. The problem is this: when "a bunch of updated information" is an integer, or a tuple, everything functions correctly. when "a bunch of updated information" is a python Dictionary, I receive the dreaded "TypeError: no method matches given arguments" message. I've tried explicitly typing the delegate argument as a PyDict, to no avail. Any suggestions? Thanks, Mark Anderson From myeates at jpl.nasa.gov Wed Mar 22 02:18:21 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Tue, 21 Mar 2006 17:18:21 -0800 Subject: [Python.NET] problems with mono 1.1.13.4 and PythonNet beta 5 Message-ID: <4420A5DD.2000001@jpl.nasa.gov> Hi I get an error when trying to create Python.Runtime.dll .\Python.cs(170,3): error CS0245: Destructors and object.Finalize cannot be called directly. Consider calling IDisposable.Dispose if available this error is preceded by a bunch of warnings (see below). Any ideas? Mathew ------------------------------------------------------------------------------ .\AssemblyManager.cs(68,23): warning CS0465: Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor? .\Exceptions.cs(48,23): warning CS0465: Introducing a 'Finalize' method can inte rfere with destructor invocation. Did you intend to declare a destructor? .\ImportHook.cs(59,23): warning CS0465: Introducing a 'Finalize' method can inte rfere with destructor invocation. Did you intend to declare a destructor? .\PyObject.cs(127,14): warning CS0465: Introducing a 'Finalize' method can inter fere with destructor invocation. Did you intend to declare a destructor? .\Python.cs(168,21): warning CS0465: Introducing a 'Finalize' method can interfe re with destructor invocation. Did you intend to declare a destructor? .\PythonException.cs(103,14): warning CS0465: Introducing a 'Finalize' method ca n interfere with destructor invocation. Did you intend to declare a destructor? .\Runtime.cs(115,23): warning CS0465: Introducing a 'Finalize' method can interf ere with destructor invocation. Did you intend to declare a destructor? .\ClassObject.cs(125,18): warning CS0219: The variable `self' is assigned but it s value is never used .\ClassObject.cs(170,18): warning CS0219: The variable `self' is assigned but it s value is never used .\ClassObject.cs(233,18): warning CS0219: The variable `self' is assigned but it s value is never used .\Converter.cs(501,2): warning CS0162: Unreachable code detected .\DelegateManager.cs(246,7): warning CS0219: The variable `r' is assigned but it s value is never used .\MetaType.cs(52,13): warning CS0219: The variable `name' is assigned but its va lue is never used .\PropertyObject.cs(47,13): warning CS0219: The variable `ts' is assigned but it s value is never used .\PropertyObject.cs(102,13): warning CS0219: The variable `ts' is assigned but i ts value is never used From meddington at gmail.com Wed Mar 22 19:33:33 2006 From: meddington at gmail.com (Michael Eddington) Date: Wed, 22 Mar 2006 19:33:33 +0100 Subject: [Python.NET] Call for bugs and features Message-ID: <4421987d.2d0c2c8e.36a4.fffff987@mx.gmail.com> If anyone out there has any known issues/bugs please enter them into the bug database on sourceforge so they can be tracked and fixed. When possible please include sample source code and information on os and .net version. Thanks! mike From myeates at jpl.nasa.gov Wed Mar 22 21:22:55 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Wed, 22 Mar 2006 12:22:55 -0800 Subject: [Python.NET] problems with mono 1.1.13.4 and PythonNet beta 5 In-Reply-To: <65531D426735784F854EE658938A5853024B23C2@MI8NYCMAIL03.Mi8.com> References: <65531D426735784F854EE658938A5853024B23C2@MI8NYCMAIL03.Mi8.com> Message-ID: <4421B21F.2010806@jpl.nasa.gov> Hi Brian I gave up trying to compile pythonnet with mcs. When I was done, mono segvs all over the place. Also, I couldn't find ildasm in the mono distribution so I used monodis instead. So now I am using the distributed pythonnet -1.0-rc2 I am running the pythonnet tests under mono and I get a few failures. 1) FAIL: Test the str() representation of an exception. The string I got from mono was: ..................String was not recognized as a valid DateTime 2) FAIL: Test implicit assembly loading via import ?? 3)also, the conversion test def test(): ConversionTest().DoubleField = 1.7976931348623159e308 did not overflow. When I do >print 1.7976931348623159e308 I get 1.#INF 4) The testRemoveInternalCallHandler test in test_events causes mono to segv. The line "from CLR.System.Windows.Forms import Form" causes this. 5) Same thing in test_method in the function testSubclassInstanceConversion Mathew From guy at r-e-d.co.nz Wed Mar 22 20:50:28 2006 From: guy at r-e-d.co.nz (Guy Robinson) Date: Thu, 23 Mar 2006 07:50:28 +1200 Subject: [Python.NET] importing System.Data Message-ID: <4421AA84.3040301@r-e-d.co.nz> Using Michaels binaries for NET2.0 I've tried everyway I know of to import System.Data and it just won't work? Can anyone confirm this... Guy From brian.d.lloyd at gmail.com Thu Mar 23 01:29:14 2006 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Wed, 22 Mar 2006 19:29:14 -0500 Subject: [Python.NET] importing System.Data In-Reply-To: <4421AA84.3040301@r-e-d.co.nz> References: <4421AA84.3040301@r-e-d.co.nz> Message-ID: <1c0b4a390603221629mc59077eu492e6103c1a9cbc2@mail.gmail.com> FWIW, I've been working on refactoring the CVS code for .NET 2.x, and I've run into this too. Something odd seems to have changed regarding Assembly.LoadXXX (I also see in the test runs that Windows.Forms has the same issue). On the bright side, those are the only two tests failing in my sandbox which has: - all the weird cdecl attributes and IL re-writing ripped out - _very_ basic representation of generics Hopefully in the next day or two I can figure out what's wrong with the assembly loading and post a basic 2.x-compatible alpha that is not feature-complete but at least runs on 2.x solidly with the current feature set. On 3/22/06, Guy Robinson wrote: > > Using Michaels binaries for NET2.0 I've tried everyway I know of to import > System.Data and it just won't work? Can anyone confirm this... > > Guy > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060322/963abce3/attachment.html From brian.d.lloyd at gmail.com Thu Mar 23 01:37:20 2006 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Wed, 22 Mar 2006 19:37:20 -0500 Subject: [Python.NET] problems with mono 1.1.13.4 and PythonNet beta 5 In-Reply-To: <4421B21F.2010806@jpl.nasa.gov> References: <65531D426735784F854EE658938A5853024B23C2@MI8NYCMAIL03.Mi8.com> <4421B21F.2010806@jpl.nasa.gov> Message-ID: <1c0b4a390603221637ye38d6bdpcd02a5b89514cb1c@mail.gmail.com> Hopefully compiling will be a lot easier soon, as all the IL rewriting voodoo will be gone. It is encouraging, though, that most of the tests run now on mono - I didn't get very far last time I tried ;^) What is the state of the mono world at this point in terms of most common version? I will try to look at these - can you tell me what platform you're on when you're seeing this? Thanks! -Brian On 3/22/06, Mathew Yeates wrote: > > Hi Brian > > I gave up trying to compile pythonnet with mcs. When I was done, mono > segvs all over the place. Also, I couldn't find ildasm in the mono > distribution so I used monodis instead. > > So now I am using the distributed pythonnet -1.0-rc2 > > I am running the pythonnet tests under mono and I get a few failures. > > 1) FAIL: Test the str() representation of an exception. > The string I got from mono was: > ..................String was not recognized as a valid DateTime > > 2) FAIL: Test implicit assembly loading via import > ?? > > 3)also, the conversion test > def test(): > ConversionTest().DoubleField = 1.7976931348623159e308 > > did not overflow. When I do >print 1.7976931348623159e308 I get > 1.#INF > > 4) The testRemoveInternalCallHandler test in test_events causes mono to > segv. The line "from CLR.System.Windows.Forms import Form" causes this. > > 5) Same thing in test_method in the > function testSubclassInstanceConversion > > Mathew > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060322/d3551e64/attachment.htm From myeates at jpl.nasa.gov Thu Mar 23 01:38:53 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Wed, 22 Mar 2006 16:38:53 -0800 Subject: [Python.NET] problems with mono 1.1.13.4 and PythonNet beta 5 In-Reply-To: <1c0b4a390603221637ye38d6bdpcd02a5b89514cb1c@mail.gmail.com> References: <65531D426735784F854EE658938A5853024B23C2@MI8NYCMAIL03.Mi8.com> <4421B21F.2010806@jpl.nasa.gov> <1c0b4a390603221637ye38d6bdpcd02a5b89514cb1c@mail.gmail.com> Message-ID: <4421EE1D.4050607@jpl.nasa.gov> windowsXP sp2 Brian Lloyd wrote: > Hopefully compiling will be a lot easier soon, as all the IL rewriting > voodoo will be gone. > > It is encouraging, though, that most of the tests run now on mono - I > didn't get very far last time I tried ;^) > > What is the state of the mono world at this point in terms of most > common version? I will try to look at these - can you tell me what > platform you're on when you're seeing this? > > Thanks! > > -Brian > > On 3/22/06, *Mathew Yeates* > wrote: > > Hi Brian > > I gave up trying to compile pythonnet with mcs. When I was done, mono > segvs all over the place. Also, I couldn't find ildasm in the mono > distribution so I used monodis instead. > > So now I am using the distributed pythonnet - 1.0-rc2 > > I am running the pythonnet tests under mono and I get a few failures. > > 1) FAIL: Test the str() representation of an exception. > The string I got from mono was: > ..................String was not recognized as a valid DateTime > > 2) FAIL: Test implicit assembly loading via import > ?? > > 3)also, the conversion test > def test(): > ConversionTest().DoubleField = 1.7976931348623159e308 > > did not overflow. When I do >print 1.7976931348623159e308 I get > 1.#INF > > 4) The testRemoveInternalCallHandler test in test_events causes > mono to > segv. The line "from CLR.System.Windows.Forms import Form" causes > this. > > 5) Same thing in test_method in the > function testSubclassInstanceConversion > > Mathew > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > > http://mail.python.org/mailman/listinfo/pythondotnet > > From f.kintzel at internet-access.de Mon Mar 27 10:50:29 2006 From: f.kintzel at internet-access.de (f.kintzel) Date: Mon, 27 Mar 2006 10:50:29 +0200 Subject: [Python.NET] System.Data.dll Message-ID: <4427A755.3070509@internet-access.de> Hi, I could not import System.Data too. The reason seems to be that the file System.Data.dll cannot be found by python. After copying it from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ to the working directory and it worked fine. best regards, Florian From i.uemlianin at bangor.ac.uk Tue Mar 28 12:45:57 2006 From: i.uemlianin at bangor.ac.uk (ivan Uemlianin) Date: Tue, 28 Mar 2006 11:45:57 +0100 Subject: [Python.NET] accessing .net dlls from python Message-ID: <442913E5.5030304@bangor.ac.uk> Dear All I'm interested in accessing .net dlls from python (e.g. to write test scripts). Is pythonnet the correct software to use? I have had a go. I have installed pythonnet and tested it with some of the code samples: all well. Putting a .net dll called foo.dll in the current directory, 'import foo' raises the following error: ImportError: dynamic module does not define init function (initfoo) Is there a liitle bit extra I need to do, or am I barking up the wrong tree? I suppose I'm looking for something that will allow me to import .net dlls as if they were python modules. Any advice much appreciated. Best wishes Ivan From roman.yakovenko at gmail.com Tue Mar 28 19:45:34 2006 From: roman.yakovenko at gmail.com (Roman Yakovenko) Date: Tue, 28 Mar 2006 19:45:34 +0200 Subject: [Python.NET] accessing .net dlls from python In-Reply-To: <442913E5.5030304@bangor.ac.uk> References: <442913E5.5030304@bangor.ac.uk> Message-ID: <7465b6170603280945i7a4326a1sb0a2b999bd6ca321@mail.gmail.com> On 3/28/06, ivan Uemlianin wrote: > Dear All > > I'm interested in accessing .net dlls from python (e.g. to write test > scripts). Is pythonnet the correct software to use? Definitely. > I have had a go. I have installed pythonnet and tested it with some of > the code samples: all well. Putting a .net dll called foo.dll in the > current directory, 'import foo' raises the following error: > > ImportError: dynamic module does not define init function (initfoo) To Brad: I think it could be nice idea to write custom import that will load .net dll automatically. I will see what can I do. The main question is how to behave with top level namespaces. > Is there a liitle bit extra I need to do, or am I barking up the wrong > tree? I suppose I'm looking for something that will allow me to import > .net dlls as if they were python modules. I could be wrong, but it seems to me that before importing something from .net dlls, you should load them first. import CLR from CLR.System.Reflection import Assembly my_dll_name = Assembly.LoadWithPartialName( path to dll that does not include .dll extension ) #import namespaces from CLR import TopNamespace > Any advice much appreciated. I hope this was helpful. > Best wishes > > Ivan -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ From hernan.martinez at ecc.es Tue Mar 28 19:53:59 2006 From: hernan.martinez at ecc.es (=?us-ascii?Q?Hernan_Martinez_Foffani?=) Date: Tue, 28 Mar 2006 19:53:59 +0200 Subject: [Python.NET] accessing .net dlls from python In-Reply-To: <442913E5.5030304@bangor.ac.uk> Message-ID: > I'm interested in accessing .net dlls from python (e.g. to write test > scripts). Is pythonnet the correct software to use? Yes. > I have had a go. I have installed pythonnet and tested it with some > of the code samples: all well. Putting a .net dll called foo.dll in > the current directory, 'import foo' raises the following error: > > ImportError: dynamic module does not define init function (initfoo) > > Is there a liitle bit extra I need to do, or am I barking up the wrong > tree? I suppose I'm looking for something that will allow me to > import .net dlls as if they were python modules. http://www.zope.org/Members/Brian/PythonNet/readme.html#importing -H. From myeates at jpl.nasa.gov Tue Mar 28 21:19:16 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Tue, 28 Mar 2006 11:19:16 -0800 Subject: [Python.NET] calling my assembly from python.net Message-ID: <44298C34.5080907@jpl.nasa.gov> Hi I know I succeeded at this once before. But I just can't get it right. I have an assembly Test.dll with a namespace Foo. Inside Foo is a method called RunMe. What is the sequence of calls I need to do for me to call RunMe??? Mathew From myeates at jpl.nasa.gov Tue Mar 28 21:43:26 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Tue, 28 Mar 2006 11:43:26 -0800 Subject: [Python.NET] calling my assembly from python.net In-Reply-To: <44298C34.5080907@jpl.nasa.gov> References: <44298C34.5080907@jpl.nasa.gov> Message-ID: <442991DE.7020204@jpl.nasa.gov> oops. It works with VisualStudio 2003 but not 2005!! Mathew Yeates wrote: > Hi > I know I succeeded at this once before. But I just can't get it right. > I have an assembly Test.dll with a namespace Foo. Inside Foo is a method > called RunMe. > > What is the sequence of calls I need to do for me to call RunMe??? > Mathew > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > > From roman.yakovenko at gmail.com Wed Mar 29 09:13:14 2006 From: roman.yakovenko at gmail.com (Roman Yakovenko) Date: Wed, 29 Mar 2006 09:13:14 +0200 Subject: [Python.NET] accessing .net dlls from python In-Reply-To: <003301c652fe$93c59c50$d50cc70a@dlh.st.com> References: <7465b6170603282254qe80c877ob10dd3201b50d6a3@mail.gmail.com> <003301c652fe$93c59c50$d50cc70a@dlh.st.com> Message-ID: <7465b6170603282313u30af0df4leb5a3959204f0b55@mail.gmail.com> On 3/29/06, Lalit DIGARI wrote: > Hello, > I have a dll named vp and I want to use it into python script dll has some > exposed function for example fn1() I did following steps in python > > import CLR > from CLR.System.Reflection import Assembly > > my_dll_name = Assembly.LoadWithPartialName('C:\\986tool\\vpci") > from CLR.System.Windows.Forms import Form > ##from CLR import TestWinForm > > my_dll_name.fn1(1) 1. I could be wrong, but .NET does not allows use of global functions. fn1 should be static function of some class 2. my_dll_name is instance of class Assembly, you can use it in order to call some function. ( Please re-check last statement, because I am not sure ). You should import it first. > > But I got two problems > 1) my_dll_name is coming none after call to LoadWithPartialName(...) > 2) the exposed function is name space TestWinForm as > using System; > using System.Drawing; > using System.Drawing.Imaging; > using System.Collections; > using System.ComponentModel; > using System.Windows.Forms; > using System.Data; > using System.Diagnostics ; > using System.Threading; > using System.Runtime.Serialization.Formatters.Binary ; > using System.IO ; > // ST Library > using STControlLibrary ; > using STImgPlatformLibrary ; > > > namespace TestWinForm > { > fn1() > { > } > } > > How will I import it into python script so that I can use exposed function. I think if you will resolve first issue and then write my_dll_name = Assembly.LoadWithPartialName('C:\\986tool\\vpci") from CLR import TestWinForm TestWinForm.GlobalFunctions.fn1(...) it will do the job. > If not clear then mail me back. > Thanks n regard's > Lalit -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ From i.uemlianin at bangor.ac.uk Wed Mar 29 11:02:50 2006 From: i.uemlianin at bangor.ac.uk (Ivan Uemlianin) Date: Wed, 29 Mar 2006 10:02:50 +0100 Subject: [Python.NET] accessing .net dlls from python In-Reply-To: <7465b6170603280945i7a4326a1sb0a2b999bd6ca321@mail.gmail.com> References: <442913E5.5030304@bangor.ac.uk> <7465b6170603280945i7a4326a1sb0a2b999bd6ca321@mail.gmail.com> Message-ID: <442A4D3A.7040608@bangor.ac.uk> Roman Yakovenko wrote: >On 3/28/06, ivan Uemlianin wrote: > > >>Is there a litle bit extra I need to do, or am I barking up the wrong >>tree? I suppose I'm looking for something that will allow me to import >>.net dlls as if they were python modules. >> >> > >I could be wrong, but it seems to me that before importing something from >.net dlls, you should load them first. > >import CLR >from CLR.System.Reflection import Assembly > >my_dll_name = Assembly.LoadWithPartialName( path to dll that does not >include .dll extension ) > >#import namespaces >from CLR import TopNamespace > > Hernan Martinez Foffani wrote: >http://www.zope.org/Members/Brian/PythonNet/readme.html#importing > Aha! Thanks! This has moved me on a lot, but I don't think I'm quite there yet: 1. Installing Python for .NET as a standalone, and using it in the interactive session, all of the above, apart from 'from CLR import TopNamespace' works. 'from CLR import TopNamespace' gets 'ImportError: cannot import name TopNamespace'. 2. Installing Python for .NET as part of my existing Python installation, and using it from within Pythonwin, none of the above works: 'import CLR' raises a 'System.IO.FileNotFoundException' - I am alerted by a 'Just-In-Time Debugging' pop-up window and Pythonwin terminates 'in an unusual way'. Should Python for .NET be used only from its own interactive prompt? Why can't it import TopNamespace and can I do without it? Thanks again for your help. This is going to be very handy: Windows and .NET are alien environments to me (I work with linux and python). Best Ivan From roman.yakovenko at gmail.com Wed Mar 29 10:54:15 2006 From: roman.yakovenko at gmail.com (Roman Yakovenko) Date: Wed, 29 Mar 2006 10:54:15 +0200 Subject: [Python.NET] accessing .net dlls from python In-Reply-To: <003401c6530c$e8eee0c0$d50cc70a@dlh.st.com> References: <7465b6170603282313u30af0df4leb5a3959204f0b55@mail.gmail.com> <003401c6530c$e8eee0c0$d50cc70a@dlh.st.com> Message-ID: <7465b6170603290054y6dadeddbg9689630a907489d7@mail.gmail.com> On 3/29/06, Lalit DIGARI wrote: > Hi Roman , Please write to the Python.Net mailing list, so other people can help you too. > I did the following step > import CLR > from CLR.System.Reflection import Assembly > > my_dll_name = Assembly.LoadWithPartialName('VPCILight') > > from CLR.System.Windows.Forms import Form > > from CLR.TestWinForm import Form1 > print my_dll_name > Form1.AutoSelectConv(1)** > > But not getting the way how to call AutoSelectConv(1) which is in > TestWinForm name space and memebr of the Form1 class how can I call it? What is the error you get? > Regard's > Lalit -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ From i.uemlianin at bangor.ac.uk Wed Mar 29 11:34:29 2006 From: i.uemlianin at bangor.ac.uk (Ivan Uemlianin) Date: Wed, 29 Mar 2006 10:34:29 +0100 Subject: [Python.NET] accessing .net dlls from python In-Reply-To: <442A4D3A.7040608@bangor.ac.uk> References: <442913E5.5030304@bangor.ac.uk> <7465b6170603280945i7a4326a1sb0a2b999bd6ca321@mail.gmail.com> <442A4D3A.7040608@bangor.ac.uk> Message-ID: <442A54A5.803@bangor.ac.uk> Ivan Uemlianin wrote: >Roman Yakovenko wrote: > > > >>On 3/28/06, ivan Uemlianin wrote: >> >> >> >> >>>Is there a litle bit extra I need to do, or am I barking up the wrong >>>tree? I suppose I'm looking for something that will allow me to import >>>.net dlls as if they were python modules. >>> >>> >>> >>> >>I could be wrong, but it seems to me that before importing something from >>.net dlls, you should load them first. >> >>import CLR >> >> >>from CLR.System.Reflection import Assembly > > >>my_dll_name = Assembly.LoadWithPartialName( path to dll that does not >>include .dll extension ) >> >>#import namespaces >> >> >>from CLR import TopNamespace > > >1. Installing Python for .NET as a standalone, and using it in the >interactive session, all of the above, apart from 'from CLR import >TopNamespace' works. 'from CLR import TopNamespace' gets 'ImportError: >cannot import name TopNamespace'. > > Duh. Of course I replace 'TopNamespace' with my own namespace. Please regard this question as a typo. Best Ivan From hernan.martinez at ecc.es Wed Mar 29 11:30:42 2006 From: hernan.martinez at ecc.es (=?us-ascii?Q?Hernan_Martinez_Foffani?=) Date: Wed, 29 Mar 2006 11:30:42 +0200 Subject: [Python.NET] accessing .net dlls from python In-Reply-To: <442A4D3A.7040608@bangor.ac.uk> Message-ID: >> import CLR >> from CLR.System.Reflection import Assembly >> >> my_dll_name = Assembly.LoadWithPartialName( path to dll that does >> not include .dll extension ) >> >> #import namespaces >> from CLR import TopNamespace > > 1. Installing Python for .NET as a standalone, and using it in the > interactive session, all of the above, apart from 'from CLR import > TopNamespace' works. 'from CLR import TopNamespace' gets > 'ImportError: cannot import name TopNamespace'. If your C# source file contains something along the lines of: namespace MyLib { public class MyClass { ... } } and, say, is compiled to a DLL called A_LIB.DLL and placed in your current directory, then in python.net it would be: from CLR.System.Reflection import Assembly a = Assembly.LoadWithPartialName("A_LIB") from CLR.MyLib import MyClass -H. From hernan.martinez at ecc.es Wed Mar 29 11:40:30 2006 From: hernan.martinez at ecc.es (=?us-ascii?Q?Hernan_Martinez_Foffani?=) Date: Wed, 29 Mar 2006 11:40:30 +0200 Subject: [Python.NET] calling my assembly from python.net In-Reply-To: <44298C34.5080907@jpl.nasa.gov> Message-ID: > I know I succeeded at this once before. But I just can't get it right. > I have an assembly Test.dll with a namespace Foo. Inside Foo is a > method called RunMe. How come? Don't you have RunMe belonging to class? > What is the sequence of calls I need to do for me to call RunMe??? You need to tell us the signature of RunMe and the accessors of both the method and the class where it belongs to. -H. From lalit.digari at st.com Thu Mar 30 07:04:31 2006 From: lalit.digari at st.com (Lalit DIGARI) Date: Thu, 30 Mar 2006 10:34:31 +0530 Subject: [Python.NET] C# .net dll used in python Message-ID: <005a01c653b7$6f17f740$d50cc70a@dlh.st.com> Hello All, I am trying to use a c# dll in python application I follows the following steps. import CLR from CLR.System.Reflection import Assembly my_dll_name = Assembly.LoadWithPartialName('VPCI') from CLR.System.Windows.Forms import Form from CLR.TestWinForm import Form1 VPCI = Form1()// Form1 is a class in my .net dll but I am getting CLR.system.DllNotFoundException:unalble to laod DLL(gpci.dll) While gpci.dll is defined in my .net application as [DllImport("gpcifunc.dll")] unsafe public static extern Int32 gpciOpen (Int32 dReserved) ; Form where the exception genrating Can any one help me out. 2) in case I am using my_dll_name = Assembly.LoadWithPartialName('path of dll') Then my_dll_name is getting none while I am keeping the dll in my python root path it is working fine Anyone has any clue. Regard's Lalit From mtraudt at quantifisolutions.com Thu Mar 30 12:34:23 2006 From: mtraudt at quantifisolutions.com (mtraudt at quantifisolutions.com) Date: Thu, 30 Mar 2006 05:34:23 -0500 Subject: [Python.NET] C# .net dll used in python In-Reply-To: <005a01c653b7$6f17f740$d50cc70a@dlh.st.com> References: <005a01c653b7$6f17f740$d50cc70a@dlh.st.com> Message-ID: <20060330053423.yru93cz89sg8scg4@www.quantifisolutions.com> > > While gpci.dll is defined in my .net application as > [DllImport("gpcifunc.dll")] > unsafe public static extern Int32 gpciOpen (Int32 dReserved) ; > Is gpcifunc.dll in your Windows %PATH% environment variable? From brian.d.lloyd at gmail.com Thu Mar 30 22:25:28 2006 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Thu, 30 Mar 2006 15:25:28 -0500 Subject: [Python.NET] System.Data.dll In-Reply-To: <4427A755.3070509@internet-access.de> References: <4427A755.3070509@internet-access.de> Message-ID: <1c0b4a390603301225x31a9f05asa73ce9f1372dd263@mail.gmail.com> Hi all -- It turns out that the lookup behavior appears to be different between 1.xand 2.x, in that 1.x was willing to look in the runtime install directory for assemblies but 2.x is not. You can work around this for now by adding the CLR runtime directory to sys.path, e.g.: sys.path.append('C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727') The runtime dir will get added to sys.path for you automatically in the next (2.x-compatible) release. -Brian On 3/27/06, f.kintzel wrote: > > Hi, > > I could not import System.Data too. The reason seems to be that the file > System.Data.dll cannot be found by python. > After copying it from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ to > the working directory and it worked fine. > > best regards, > > Florian > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060330/40490612/attachment.htm From lalit.digari at st.com Fri Mar 31 07:18:22 2006 From: lalit.digari at st.com (Lalit DIGARI) Date: Fri, 31 Mar 2006 10:48:22 +0530 Subject: [Python.NET] C# .net dll used in python In-Reply-To: <20060330053423.yru93cz89sg8scg4@www.quantifisolutions.com> Message-ID: <008101c65482$88f30f30$d50cc70a@dlh.st.com> Thanks buddy , I got the point path was not proper for that dll Can u thorugh some light on the problem which is coming 1)my_dll_name = Assembly.LoadWithPartialName('C:\\986tool\\vpci) 2)my_dll_name = Assembly.LoadWithPartialName('vpci') In case 1 my_dll_name is coming none while in case 2 works fine any clue Thanks -----Original Message----- From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of mtraudt at quantifisolutions.com Sent: Thursday, March 30, 2006 4:04 PM To: pythondotnet at python.org Subject: Re: [Python.NET] C# .net dll used in python > > While gpci.dll is defined in my .net application as > [DllImport("gpcifunc.dll")] > unsafe public static extern Int32 gpciOpen (Int32 dReserved) ; > Is gpcifunc.dll in your Windows %PATH% environment variable? _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet From Georgi.Yankov at alcatel.de Tue Mar 14 09:52:33 2006 From: Georgi.Yankov at alcatel.de (Yankov, Georgi (SMB)) Date: Tue, 14 Mar 2006 08:52:33 -0000 Subject: [Python.NET] Python .NET Message-ID: <866EBC3822F44C418D8431C2A950EAD18A5C85@slbnt24.dunkermotoren.net> Gentlemen, I need your help. I have a Windows-Application, created with Microsoft Visual Studio.NET 2005 (C#). I want to use Python as embedded Script language. It will be great. I want to create three Text-Windows: - 1st Window is for Python text editor with one "Run"-button (execute Input text). - 2nd Windows is for Output messages (like Python's "print" commands) (Output text). - 3rd Window is for Python interpreter - Output Error messages (Output text - error text such error message and error's line number). Where can I find more information about this possibility (or samples) ? It will be very nice if you send me a sample with embedded Python for MS Visual Studio.NET (like a Python Editor) ! I need full Python functionality with all Python libraries (not limited version of Python, like IronPython for .NET) Thank you in advantage! Best regards Georgi Yankov DUNKERMOTOREN - advanced motion solutions Dipl.-Ing. Georgi Yankov Application Services Alcatel SEL AG Components Division Dunkermotoren Allmendstrasse 11 79848 Bonndorf Germany georgi.yankov at alcatel.de www.dunkermotoren.de tel: fax: +49 (0) 7703/930-468 +49 (0) 7703/930-217 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060314/fb451062/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 455 bytes Desc: att6769b.gif Url : http://mail.python.org/pipermail/pythondotnet/attachments/20060314/fb451062/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 594 bytes Desc: att676ba.gif Url : http://mail.python.org/pipermail/pythondotnet/attachments/20060314/fb451062/attachment-0001.gif From mark.mcmahon at eur.autodesk.com Fri Mar 17 19:45:02 2006 From: mark.mcmahon at eur.autodesk.com (Mark McMahon) Date: Fri, 17 Mar 2006 13:45:02 -0500 Subject: [Python.NET] reg editor Message-ID: <4187BAA24A3D094F925AEE0BE39B7077022C74F2@msgusaemb01.autodesk.com> Hi, > From: chatting chatting > > Hi > what editor is used for IronPython. Before I give any answer, please have a look at something like: http://www.gweep.ca/~edmonds/usenet/ml-etiquette.html So you want a Reg(istry?) Editor (from title) for IronPython - but asking on the Python.NET mailing list (OK - I do agree that the distinction between IronPython and Python.NET is probably not readily apparent to most people.) Regedit is a good registry editor - I don't think I have ever needed to use anything else. Now IronPython code is essentially Python code, so it is a Text file - so you might want to look at Text Editors. You can read a review of some editors here: http://spyced.blogspot.com/2005/09/review-of-6-python-ides.html > > pelase help me I hope I have > > bye > regs > Babu > Mark From mark.mcmahon at eur.autodesk.com Thu Mar 30 15:24:58 2006 From: mark.mcmahon at eur.autodesk.com (Mark McMahon) Date: Thu, 30 Mar 2006 08:24:58 -0500 Subject: [Python.NET] C# .net dll used in python Message-ID: <4187BAA24A3D094F925AEE0BE39B7077024E6C3D@msgusaemb01.autodesk.com> Hi, It would look to me like the gpcifunc.dll is a C dll not a .NET one? Isn't that what DllImport is for (note I do not know .NET very well - so I could be wrong). If it is a C Dll - then what you need to access that method is probably ctypes. Mark -----Original Message----- From: pythondotnet-bounces at python.org [mailto:pythondotnet-bounces at python.org] On Behalf Of Lalit DIGARI Sent: Thursday, March 30, 2006 7:05 AM To: pythondotnet at python.org Subject: [Python.NET] C# .net dll used in python Hello All, I am trying to use a c# dll in python application I follows the following steps. import CLR from CLR.System.Reflection import Assembly my_dll_name = Assembly.LoadWithPartialName('VPCI') from CLR.System.Windows.Forms import Form from CLR.TestWinForm import Form1 VPCI = Form1()// Form1 is a class in my .net dll but I am getting CLR.system.DllNotFoundException:unalble to laod DLL(gpci.dll) While gpci.dll is defined in my .net application as [DllImport("gpcifunc.dll")] unsafe public static extern Int32 gpciOpen (Int32 dReserved) ; Form where the exception genrating Can any one help me out. 2) in case I am using my_dll_name = Assembly.LoadWithPartialName('path of dll') Then my_dll_name is getting none while I am keeping the dll in my python root path it is working fine Anyone has any clue. Regard's Lalit _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet From chatting.chatting at gmail.com Thu Mar 16 13:10:32 2006 From: chatting.chatting at gmail.com (chatting chatting) Date: Thu, 16 Mar 2006 12:10:32 -0000 Subject: [Python.NET] reg editor Message-ID: Hi What editor can i use for pythondot net. currently i am using Python2.4IDLE. while importing i will get error "no module " please let me know what editor and where i can download this. This will be very helpful for me. thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythondotnet/attachments/20060316/5c341268/attachment.html From Brian.Lloyd at revolution.com Fri Mar 31 22:42:53 2006 From: Brian.Lloyd at revolution.com (Brian Lloyd) Date: Fri, 31 Mar 2006 15:42:53 -0500 Subject: [Python.NET] Naming and resolution of generic types (complete!) Message-ID: <65531D426735784F854EE658938A585302798CCA@MI8NYCMAIL03.Mi8.com> Hi all - I'm cross-posting this to the IP list as the subject seems to be an open issue there too. I'm working on generics support for Python for .NET, and there a couple of thorny issues that could use some discussion regarding naming and resolution of generic types. In C# you can explicitly name a generic type, a la Dictionary<,>. That syntax won't work in Python, of course. Looking at IP, it seems to allow the apparent Python name to be the unmangled IL name so you can naturally use the name. The problem is that the mangled name is illegal as a python name, and the unmangled name isn't guaranteed to be unique - you can potentially have any number of generic types as well as a non-generic type with the same base name in the same namespace: namespace Spam { public class SpamCan {} public class SpamCan {} public class SpamCan {} ... } I imagine that maybe IP has enough information available at compile-time to do the right thing for some common usage (binding and instantiating the types), but the overloaded name can still be ambiguous. A real-life example of this is System.IComparable - in IP, it doesn't seem possible to get to the non-generic version of IComparable anymore (or at least it was not obvious to me how to do it): >>> import System >>> System.IComparable It seems like we need to figure out some acceptable way of spelling generic type names explicitly in Python (an equivalent to IComparable<> in C#) that works within the existing syntax. There don't appear to be a lot of great options :( It has to be a valid Python name to work in an import statement, so that rules out strange operator shenanigans akin to the [] hack used for generic type binding. One would be to mimic the existing IL mangling in some way, a la: >From System import IComparable # the non-generic type >From System import IComparable_1 # the 1-param generic # or from System import IComparable_T from System.Collections.Generic import Dictionary_TT These are all pretty gross, and still don't totally prevent hiding of legit non-generic classes with those names (though it makes it less likely that names will be hidden than the current approach). I suppose another approach would be to continue to have only one type end up with the simple name, but provide a way to disambiguate it after the fact: >>> import System >>> System.IComparable >>> # abandon all hope, ye who enter here... >>> NonGenericIComparable = System.IComparable<<0 >>> OneParamGenericIComparable = System.IComparable<<1 >>> TwoParamVersionIfThereWasOne = System.IComparable<<2 That feels to me like it violates Python Zen in several ways, though. Thoughts? -Brian From roman.yakovenko at gmail.com Fri Mar 31 23:07:42 2006 From: roman.yakovenko at gmail.com (Roman Yakovenko) Date: Sat, 1 Apr 2006 00:07:42 +0300 Subject: [Python.NET] reg editor In-Reply-To: References: Message-ID: <7465b6170603311307jc0f15eape18cff28c5e4e4e3@mail.gmail.com> On 3/16/06, chatting chatting wrote: > > Hi > > What editor can i use for pythondot net. currently i am using Python2.4 > IDLE. while importing i will get error "no module " please let me know what > editor and where i can download this. This will be very helpful for me. This has nothing to do with Idle or editor. I think you should adjust sys.path variable or to load your dll's using absolute path ( and be sure you can access dll's your .NET dll depends on. As for the editor I prefer SciTe. > thanks > > Babu > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > > -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/