From jorn_vanloofsvelt at hotmail.com Wed Apr 4 16:34:52 2012 From: jorn_vanloofsvelt at hotmail.com (Jorn Vanloofsvelt) Date: Wed, 4 Apr 2012 14:34:52 +0000 Subject: [Python.NET] =?windows-1256?q?Using_a_managed_private_DLL_in_pyth?= =?windows-1256?q?on_for_=2ENET=FE?= Message-ID: Dear Brian My question is very short, and I hope that the answer is simple but I have not been able to find an answer on the web. I am using python for .NET, I want to use a private managed DLL. My code looks as follows: import clr from clr import System clr.AddReference("OneWireAPI") That works, however I am unable to get the namespace or its classes. How am I supposed to do this? I figured "from clr import namespace", but that didn't work. I have also tried Assembly.LoadFromFile() Here is an example of usage of this DLL: http://files.maxim-ic.com/sia_bu/softdev/owdocs_400beta2/Docs/OW.NET/OW.NET_Primer.html Greetings Jorn -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian.d.lloyd at gmail.com Fri Apr 6 17:55:38 2012 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Fri, 6 Apr 2012 11:55:38 -0400 Subject: [Python.NET] =?utf-8?q?Using_a_managed_private_DLL_in_python_for_?= =?utf-8?b?Lk5FVOKAjw==?= In-Reply-To: References: Message-ID: What is the top level namespace exported by that assembly? Assuming it was 'OneWire' you should be able to do: import clr clr.addReference("OneWireAPI") import OneWire ... Hope this helps! - Brian 2012/4/4 Jorn Vanloofsvelt > Dear Brian > > My question is very short, and I hope that the answer is simple but I have > not been able to find an answer on the web. > > I am using python for .NET, I want to use a private managed DLL. My code > looks as follows: > > import clr > from clr import System > > clr.AddReference("OneWireAPI") > > > That works, however I am unable to get the namespace or its classes. How > am I supposed to do this? > I figured "from clr import namespace", but that didn't work. I have also > tried Assembly.LoadFromFile() > > Here is an example of usage of this DLL: > > http://files.maxim-ic.com/sia_bu/softdev/owdocs_400beta2/Docs/OW.NET/OW.NET_Primer.html > > Greetings > Jorn > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > -- Brian Lloyd brian.d.lloyd at gmail.com (c) 540.845.2975 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xingying.cheng at finisar.com Fri Apr 6 18:59:38 2012 From: xingying.cheng at finisar.com (Xingying Cheng) Date: Fri, 6 Apr 2012 09:59:38 -0700 Subject: [Python.NET] Python call .Net DLL Message-ID: <7D50542B159442478CA4A67DDFAA44390D870AEE@SNY-EXCHANGE.ads.finisar.com> Hi, I am trying to call .net dll from python. Is there any instruction that I can follow, since there are some classes in the dll file and I cannot use the traditional ctypes to get the methods in the classes. Could anyone help me with that? Thanks, Xingying -------------- next part -------------- An HTML attachment was scrubbed... URL: From barton at bcdesignswell.com Sun Apr 8 00:32:26 2012 From: barton at bcdesignswell.com (Barton) Date: Sat, 07 Apr 2012 15:32:26 -0700 Subject: [Python.NET] Python call .Net DLL In-Reply-To: <7D50542B159442478CA4A67DDFAA44390D870AEE@SNY-EXCHANGE.ads.finisar.com> References: <7D50542B159442478CA4A67DDFAA44390D870AEE@SNY-EXCHANGE.ads.finisar.com> Message-ID: <4F80C07A.4010201@bcdesignswell.com> You can get started here http://pythonnet.sourceforge.net/readme.html On 04/06/2012 09:59 AM, Xingying Cheng wrote: > Hi, > > I am trying to call .net dll from python. Is there any instruction that > I can follow, since there are some classes in the dll file and I cannot > use the traditional ctypes to get the methods in the classes. > > Could anyone help me with that? > > Thanks, > > Xingying > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet From barton at bcdesignswell.com Sun Apr 8 01:27:47 2012 From: barton at bcdesignswell.com (Barton) Date: Sat, 07 Apr 2012 16:27:47 -0700 Subject: [Python.NET] =?utf-8?q?Using_a_managed_private_DLL_in_python_for_?= =?utf-8?b?Lk5FVOKAjw==?= In-Reply-To: References: Message-ID: <4F80CD73.3070006@bcdesignswell.com> import clr clr.AddReference("OneWireAPI") import OneWireAPI as OW # Now you may access the classes, etc on the library # Have fun with that! NOTE: I haven't tried this. # OneWireContainer enumeration for owc in OW.getAllDeviceContainers(): print owc.getDescription () On 04/04/2012 07:34 AM, Jorn Vanloofsvelt wrote: > Dear Brian > > My question is very short, and I hope that the answer is simple but I > have not been able to find an answer on the web. > > I am using python for .NET, I want to use a private managed DLL. My code > looks as follows: > > import clr > from clr import System > > clr.AddReference("OneWireAPI") > > > That works, however I am unable to get the namespace or its classes. How > am I supposed to do this? > I figured "from clr import namespace", but that didn't work. I have also > tried Assembly.LoadFromFile() > > Here is an example of usage of this DLL: > http://files.maxim-ic.com/sia_bu/softdev/owdocs_400beta2/Docs/OW.NET/OW.NET_Primer.html > > Greetings > Jorn > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet From brad at fie.us Sat Apr 21 22:36:48 2012 From: brad at fie.us (Bradley Friedman) Date: Sat, 21 Apr 2012 15:36:48 -0500 Subject: [Python.NET] anonymous types from bug tracker Message-ID: Hi all. So I ran into what looks like a bug. Someone else logged it on the sourceforge bug tracker. http://sourceforge.net/tracker/?func=detail&aid=3415722&group_id=162464&atid=823891 I worked around it as the submitter suggests. However, I have two queries. Firstly, is the bug tracker the right place to deal with these things? Or is this mailing list the right place. I ask because the referenced bug doesn't seem to have been looked at all that much. Second, is the suggested work around the correct course of action? Should pythonnet ignore anonymous types? Bradley Friedman VFX and Animation Consulting and Technology http://www.fie.us/ brad at fie.us From stephenp at otakuworld.com Sun Apr 22 18:22:01 2012 From: stephenp at otakuworld.com (Stephen P. Lepisto) Date: Sun, 22 Apr 2012 09:22:01 -0700 Subject: [Python.NET] anonymous types from bug tracker In-Reply-To: References: Message-ID: <4F943029.6020305@otakuworld.com> Bradley, Can you provide a simple reproduction case? On 4/21/2012 1:36 PM, Bradley Friedman wrote: > Hi all. > > So I ran into what looks like a bug. Someone else logged it on the sourceforge bug tracker. > > http://sourceforge.net/tracker/?func=detail&aid=3415722&group_id=162464&atid=823891 > > I worked around it as the submitter suggests. However, I have two queries. > > Firstly, is the bug tracker the right place to deal with these things? Or is this mailing list the right place. I ask because the referenced bug doesn't seem to have been looked at all that much. > > Second, is the suggested work around the correct course of action? Should pythonnet ignore anonymous types? > > Bradley Friedman > VFX and Animation > Consulting and Technology > http://www.fie.us/ > brad at fie.us > > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > -- Stephen P. Lepisto From barton at bcdesignswell.com Sun Apr 22 20:22:35 2012 From: barton at bcdesignswell.com (Barton) Date: Sun, 22 Apr 2012 11:22:35 -0700 Subject: [Python.NET] anonymous types from bug tracker In-Reply-To: <4F943029.6020305@otakuworld.com> References: <4F943029.6020305@otakuworld.com> Message-ID: <4F944C6B.2050901@bcdesignswell.com> Indeed, the mailing list gets more attention than the tracker. I do, however, maintain the tracker as often as I am able. As the submitter suggests: [quote] In method GenericUtil.Register(Type t) there is no test for types which t.Namespace is null. Simple correction is just check if t.Namespace is null and then don`t process that type. [/quote] I've had this on my list of things to commit to the trunk, but have gotten sidetracked (by, among other things, building up a new Arch Linux system). I will do my best to get to my list as quickly as I can. Thank you so very much, Barton On 04/22/2012 09:22 AM, Stephen P. Lepisto wrote: > Bradley, > > Can you provide a simple reproduction case? > > > On 4/21/2012 1:36 PM, Bradley Friedman wrote: >> Hi all. >> >> So I ran into what looks like a bug. Someone else logged it on the >> sourceforge bug tracker. >> >> http://sourceforge.net/tracker/?func=detail&aid=3415722&group_id=162464&atid=823891 >> >> >> I worked around it as the submitter suggests. However, I have two >> queries. >> >> Firstly, is the bug tracker the right place to deal with these things? >> Or is this mailing list the right place. I ask because the referenced >> bug doesn't seem to have been looked at all that much. >> >> Second, is the suggested work around the correct course of action? >> Should pythonnet ignore anonymous types? >> >> Bradley Friedman >> VFX and Animation >> Consulting and Technology >> http://www.fie.us/ >> brad at fie.us >> >> >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> http://mail.python.org/mailman/listinfo/pythondotnet >> > From brad at fie.us Sun Apr 22 20:35:10 2012 From: brad at fie.us (Brad Friedman) Date: Sun, 22 Apr 2012 13:35:10 -0500 Subject: [Python.NET] anonymous types from bug tracker In-Reply-To: <4F944C6B.2050901@bcdesignswell.com> References: <4F943029.6020305@otakuworld.com> <4F944C6B.2050901@bcdesignswell.com> Message-ID: <809D6D0B-1093-455E-A7C5-85CB1570614F@fie.us> If you feel the suggestion is correct I might take a crack at it. If for no other reason than to get my hands dirty. Do you feel the suggestion is correct? An alternative might be to create a virtual module like say: clr.anonymous, to put them in? Or do we look to IronPython here? On Apr 22, 2012, at 1:22 PM, Barton wrote: > Indeed, the mailing list gets more attention than the tracker. I do, however, maintain the tracker as often as I am able. > > As the submitter suggests: > [quote] > In method GenericUtil.Register(Type t) there is no test for types which t.Namespace is null. > Simple correction is just check if t.Namespace is null and then don`t process that type. > [/quote] > > I've had this on my list of things to commit to the trunk, but have gotten sidetracked (by, among other things, building up a new Arch Linux system). I will do my best to get to my list as quickly as I can. > > Thank you so very much, > Barton > > On 04/22/2012 09:22 AM, Stephen P. Lepisto wrote: >> Bradley, >> >> Can you provide a simple reproduction case? >> >> >> On 4/21/2012 1:36 PM, Bradley Friedman wrote: >>> Hi all. >>> >>> So I ran into what looks like a bug. Someone else logged it on the >>> sourceforge bug tracker. >>> >>> http://sourceforge.net/tracker/?func=detail&aid=3415722&group_id=162464&atid=823891 >>> >>> >>> I worked around it as the submitter suggests. However, I have two >>> queries. >>> >>> Firstly, is the bug tracker the right place to deal with these things? >>> Or is this mailing list the right place. I ask because the referenced >>> bug doesn't seem to have been looked at all that much. >>> >>> Second, is the suggested work around the correct course of action? >>> Should pythonnet ignore anonymous types? >>> >>> Bradley Friedman >>> VFX and Animation >>> Consulting and Technology >>> http://www.fie.us/ >>> brad at fie.us >>> >>> >>> >>> >>> _________________________________________________ >>> Python.NET mailing list - PythonDotNet at python.org >>> http://mail.python.org/mailman/listinfo/pythondotnet >>> >> > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet From qq371811291 at yahoo.cn Sun Apr 29 02:36:51 2012 From: qq371811291 at yahoo.cn (Zhang Fan) Date: Sun, 29 Apr 2012 08:36:51 +0800 (CST) Subject: [Python.NET] no module named CLR after install with existing python Message-ID: <1335659811.38730.YahooMailClassic@web92410.mail.cnh.yahoo.com> hi, I try to install python for .net with existing python on windows, but after that, it said "no module named CLR" when I import CLR. Can anyone help me? -------------- next part -------------- An HTML attachment was scrubbed... URL: From barton at BCDesignsWell.com Sun Apr 29 19:32:25 2012 From: barton at BCDesignsWell.com (Barton) Date: Sun, 29 Apr 2012 10:32:25 -0700 Subject: [Python.NET] no module named CLR after install with existing python In-Reply-To: <1335659811.38730.YahooMailClassic@web92410.mail.cnh.yahoo.com> References: <1335659811.38730.YahooMailClassic@web92410.mail.cnh.yahoo.com> Message-ID: <4F9D7B29.7090108@BCDesignsWell.com> First try import clr ## small letters, but the deprecated CLR should still work. There is no actual "install" operation at this point. When you are starting out, the easiest thing is to do on Windows is put the Python.Runtime.dll and associated files right into your python install folder (say C:\Python26, or where ever python happens to be installed). On 4/28/2012 5:36 PM, Zhang Fan wrote: > hi, I try to install python for .net with existing python on windows, > but after that, it said "no module named CLR" when I import CLR. Can > anyone help me? > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: