From Liam.Corrigan at allenvanguard.com Wed Oct 10 20:21:07 2012 From: Liam.Corrigan at allenvanguard.com (Liam Corrigan) Date: Wed, 10 Oct 2012 18:21:07 +0000 Subject: [Python.NET] .NET 4.0 Extension methods Message-ID: <6E12B73DC225AD42A599ADB1B4EBD83003D28437@SRVNA-EX02.allenvanguard.local> Hi, I'm using my own python .NET 4.0 build and I'm trying to access some extension methods for a concurrent queue. However, the console only shows methods and not extension methods. In visual studio 2010 C# .NET 4.0, I can see all the extension methods in the Intellisense/Autocomplete options. More specifically, I'm doing this following. import clr4 import System from System import * from System.Collections.Generic import * from System.Collections.Concurrent import * q1 = System.Collections.Concurrent.ConcurrentQueue[System.Double]() # Attempting to get this extension method's return value. # in CSharp I would just call this extension method to get the last item's value # without dequeueing it. val = q1.Last() # but the python console tells me the object has no attribute 'Last' Is this a known limitation, or is it something specific in how they must be called? This message is intended only for the use of the named addressee. It may contain information that is copywritten, privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately and delete it from your system. Communications using this system are monitored and recorded for lawful business purposes. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at fie.us Sat Oct 27 04:38:04 2012 From: brad at fie.us (brad at fie.us) Date: Fri, 26 Oct 2012 22:38:04 -0400 Subject: [Python.NET] assemblymanager and reflection only assemblies Message-ID: <3D258D00-197D-4F63-A172-BF2747A5DF02@fie.us> fyi: I ran into a bug and fixed it? I think? Some thoughts on what I did? I am writing an application that loads plugins. As part of that, it first loads the plugin assembly in "reflection only" mode. pythonnet's assemblymanager.cs registers a handler at line 54. it gets called when I load the assembly? even in reflection mode. Which I think is correct. the handler begins at line 88. it was throwing an exception when it tries to "ScanAssembly()" on the passed assembly. More specifically when it tried to load the types. If I'm reading the code right, it should not attempt to scan the assembly because it is loaded reflection only. One can check this with the "ReflectionOnly" property of the provided assembly. So I surrounded the rest of the code in a "if" conditional and only add the assembly and scan it, if it is not "RefelctionOnly." Is that the right thing to do? It's gotten rid of my problem. But I wonder if its strictly correct to both not add it to the assemblies collection in the manager and also not scan it. Thoughts? I don't want to submit a patch if it's not really the right approach to the matter. From jfburkhart.reg at gmail.com Tue Oct 30 13:19:29 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Tue, 30 Oct 2012 13:19:29 +0100 Subject: [Python.NET] compiling for .NET CLR4, Python 2.7 Message-ID: Hello, I'm new to .NET and just trying to make available a few .NET dll files for an application I would *like* to build in CPython. I'm trying to use pythonnet for the task as I would prefer not to use IronPython. I have Python 2.7 installed on a 64bit Windows 7 PC. I have managed to get the latest svn version, confirmed required changes according to: http://blog.bidiuk.com/2011/01/python-net-and-vs2010-net-4/ were made. Though, it seemed most were no longer necessary in the latest SVN version. I also changed the Conditional Compilation symbols to: PYTHON27,UCS2 under the Python.Runtime, Properties->Build tab. I rebuilt the entire solution, and all compiled with no errors. However, I get the following when I try to run Python.exe: PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> .\python.exe ImportError: No module named site PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> Does anyone have experience building pythonnet for Python 2.7 and .NET 4? Thank you in advance, john -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstanleyjones at gmail.com Tue Oct 30 21:39:45 2012 From: tstanleyjones at gmail.com (Thomas Stanley-Jones) Date: Tue, 30 Oct 2012 15:39:45 -0500 Subject: [Python.NET] compiling for .NET CLR4, Python 2.7 In-Reply-To: References: Message-ID: I also tried to build on a 64bit Windows 7 machine and was not able to make it work consistently. I was told that the issue was with the version of VS that I used to build PythonNet. I am not knowledgeable in this area however, and could not figure out how to get it to work consistently. I was trying to use it with a distribution of CPython 2.6 (which caused me the most trouble) and CPython 2.7. I stopped working on it as I could only get 2.7 to see the PythonNet module. I'm curious what answers you come up with as I would still love to get this to work on my machine. Thomas On Tue, Oct 30, 2012 at 7:19 AM, John Burkhart wrote: > Hello, > > I'm new to .NET and just trying to make available a few .NET dll files for > an application I would *like* to build in CPython. I'm trying to use > pythonnet for the task as I would prefer not to use IronPython. I have > Python 2.7 installed on a 64bit Windows 7 PC. > > I have managed to get the latest svn version, confirmed required changes > according to: > http://blog.bidiuk.com/2011/01/python-net-and-vs2010-net-4/ > > were made. Though, it seemed most were no longer necessary in the latest > SVN version. > > I also changed the Conditional Compilation symbols to: PYTHON27,UCS2 under > the Python.Runtime, Properties->Build tab. > > I rebuilt the entire solution, and all compiled with no errors. > > However, I get the following when I try to run Python.exe: > > PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> > .\python.exe > ImportError: No module named site > PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> > > Does anyone have experience building pythonnet for Python 2.7 and .NET 4? > > Thank you in advance, > john > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From niki at vintech.bg Wed Oct 31 10:06:25 2012 From: niki at vintech.bg (niki) Date: Wed, 31 Oct 2012 11:06:25 +0200 Subject: [Python.NET] compiling for .NET CLR4, Python 2.7 In-Reply-To: References: Message-ID: <5090EA11.3020308@vintech.bg> On 30.10.2012 14:19, John Burkhart wrote:> Hello, > > I'm new to .NET and just trying to make available a few .NET dll files for > an application I would *like* to build in CPython. I'm trying to use > pythonnet for the task as I would prefer not to use IronPython. I have > Python 2.7 installed on a 64bit Windows 7 PC. Are you using VS2008? If not try. Niki