From Kenny_Koller at bio-rad.com Wed May 16 03:30:05 2012 From: Kenny_Koller at bio-rad.com (Kenny Koller) Date: Tue, 15 May 2012 18:30:05 -0700 Subject: [Python.NET] Is Python .NET Alive? Message-ID: An HTML attachment was scrubbed... URL: From barton at bcdesignswell.com Wed May 16 04:34:28 2012 From: barton at bcdesignswell.com (Barton) Date: Tue, 15 May 2012 19:34:28 -0700 Subject: [Python.NET] Is Python .NET Alive? In-Reply-To: References: Message-ID: <4FB31234.4050506@bcdesignswell.com> Nope, it's not dying. Still actively maintained, accepting patches (and applying them when I get a chance). On the other hand, I've heard it rumored that IronClad is not as active due to IronPython work to integrate SciPy and NumPy??? You've hit on the real beauty of this package - no bloat and the downside - no installer on Windows and limited docs. It will drop right into your /pythonxx/dlls folder on Windows. There's a setup.py for Linux install. The list is active for questions. Although I'm not an imbedder, I've had great success calling .NET/Mono libs from python. It's certainly worth some quick experimentation to see if it will meet your needs. Have fun! On 05/15/2012 06:30 PM, Kenny Koller wrote: > Hi, > > I'm currently trying to access both a managed and unmanaged DLL. The > former gives me access to a high resolution encoder via USB and the > latter our motion control system also via USB using ctypes. > > I'll need to mix this kind of this often during our development cycle > and I'm looking for a long term solution. > > IronPython works surprisingly well but I'm not sure IronClad is quite > there to give me access to ctypes. Also the load time is slow when > running scripts quickly back-to-back which I do often. > > Python for .NET looks to be a nice solution because I can access the > CPython stuff without worry but I find the documentation lacking and > it's unclear how active this project is. On the documentation side I > just find these .zip downloads but I could not find the installers that > are mentioned to integrate with an existing 2.7 installation Python. > > So is this dying? Will you share with me why you are using this rather > than IronPython? > > I hope this doesn't sound harsh. I think these kinds of efforts are > fantastic. > > Thanks, > > Kenny > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet From brian.d.lloyd at gmail.com Wed May 16 05:11:00 2012 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Tue, 15 May 2012 23:11:00 -0400 Subject: [Python.NET] Is Python .NET Alive? In-Reply-To: References: Message-ID: Not dying -- its just a flesh wound! :^) At the end of the day Python for .NET is a pretty niche thing, so there is not a ton of activity, but Barton and others have been really great about giving it some cycles and being responsive to people on the list. The project predates IronPython, so that may be the de-facto answer for why some people have chosen to use it. In any case, there are plenty of people using it to solve some interesting integration problems. If the current code can bridge your gap, it's worth giving it a shot. That said, if you think you will need to be tracking the leading edge of either Python or .NET development then Python for .NET or IronPython might not be the right path, as right now I'm not sure either project has enough contributors with enough "skin in the game" to commit to significant upgrades (support for Python 3.x, future versions of .NET/CLR etc.). In that case you might be better off wrapping your motion control lib using the unsafe / FFI features of the CLR directly rather than mucking with ctypes. Not to scare you off, just my 0.02 ;^) - Brian On Tue, May 15, 2012 at 9:30 PM, Kenny Koller wrote: > Hi, > > I'm currently trying to access both a managed and unmanaged DLL. The > former gives me access to a high resolution encoder via USB and the latter > our motion control system also via USB using ctypes. > > I'll need to mix this kind of this often during our development cycle and > I'm looking for a long term solution. > > IronPython works surprisingly well but I'm not sure IronClad is quite > there to give me access to ctypes. Also the load time is slow when running > scripts quickly back-to-back which I do often. > > Python for .NET looks to be a nice solution because I can access the > CPython stuff without worry but I find the documentation lacking and it's > unclear how active this project is. On the documentation side I just find > these .zip downloads but I could not find the installers that are mentioned > to integrate with an existing 2.7 installation Python. > > So is this dying? Will you share with me why you are using this rather > than IronPython? > > I hope this doesn't sound harsh. I think these kinds of efforts are > fantastic. > > Thanks, > > Kenny > > > _________________________________________________ > 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 brad at fie.us Wed May 16 06:24:12 2012 From: brad at fie.us (Brad Friedman) Date: Wed, 16 May 2012 00:24:12 -0400 Subject: [Python.NET] Is Python .NET Alive? In-Reply-To: References: Message-ID: <91E3B118-8DDC-4AFC-8765-3C96326C905B@fie.us> MoCo eh? You may want to look into cython. It's a good complimentary tech. I find that looking for binary releases of python.net is futile. I do the equivalent of static compiling into my projects. Even if you get the right python version... 32 vs 64? Pyuic 2 vs 4? Too many variables. If you do the "right thing" and listen to supported version info, you can't get a single module built binary compatible between RHEL linux's python, and autodesk Maya's statically linked python. Why should python.net work without compiling separate versions too? Once you accept that c python isn't binary compatible with itself, compiling python.net into your apps and environment makes a lot more sense. You might also consider RPC approaches. Pickle works in both. I've considered looking into pyro to communicate between cpython and iron python as well. I keep coming back to python.net though. On May 15, 2012, at 9:30 PM, Kenny Koller wrote: > Hi, > > I'm currently trying to access both a managed and unmanaged DLL. The former gives me access to a high resolution encoder via USB and the latter our motion control system also via USB using ctypes. > > I'll need to mix this kind of this often during our development cycle and I'm looking for a long term solution. > > IronPython works surprisingly well but I'm not sure IronClad is quite there to give me access to ctypes. Also the load time is slow when running scripts quickly back-to-back which I do often. > > Python for .NET looks to be a nice solution because I can access the CPython stuff without worry but I find the documentation lacking and it's unclear how active this project is. On the documentation side I just find these .zip downloads but I could not find the installers that are mentioned to integrate with an existing 2.7 installation Python. > > So is this dying? Will you share with me why you are using this rather than IronPython? > > I hope this doesn't sound harsh. I think these kinds of efforts are fantastic. > > Thanks, > > Kenny > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at fie.us Wed May 16 07:50:20 2012 From: brad at fie.us (Bradley Friedman) Date: Wed, 16 May 2012 01:50:20 -0400 Subject: [Python.NET] Is Python .NET Alive? In-Reply-To: <91E3B118-8DDC-4AFC-8765-3C96326C905B@fie.us> References: <91E3B118-8DDC-4AFC-8765-3C96326C905B@fie.us> Message-ID: <780B94AC-4DEB-4F36-9597-BB0EF38B26C5@fie.us> Sorry. That would be ucs4 vs ucs2. Never post to a mailing list drunk or risk confusing obscure Unicode protocols with obscure pyqt tools. Learn from my mistakes. Sent from my iPad On May 16, 2012, at 12:24 AM, Brad Friedman wrote: > MoCo eh? You may want to look into cython. It's a good complimentary tech. I find that looking for binary releases of python.net is futile. I do the equivalent of static compiling into my projects. > > Even if you get the right python version... 32 vs 64? Pyuic 2 vs 4? Too many variables. > > If you do the "right thing" and listen to supported version info, you can't get a single module built binary compatible between RHEL linux's python, and autodesk Maya's statically linked python. Why should python.net work without compiling separate versions too? > > Once you accept that c python isn't binary compatible with itself, compiling python.net into your apps and environment makes a lot more sense. > > You might also consider RPC approaches. Pickle works in both. I've considered looking into pyro to communicate between cpython and iron python as well. I keep coming back to python.net though. > > On May 15, 2012, at 9:30 PM, Kenny Koller wrote: > >> Hi, >> >> I'm currently trying to access both a managed and unmanaged DLL. The former gives me access to a high resolution encoder via USB and the latter our motion control system also via USB using ctypes. >> >> I'll need to mix this kind of this often during our development cycle and I'm looking for a long term solution. >> >> IronPython works surprisingly well but I'm not sure IronClad is quite there to give me access to ctypes. Also the load time is slow when running scripts quickly back-to-back which I do often. >> >> Python for .NET looks to be a nice solution because I can access the CPython stuff without worry but I find the documentation lacking and it's unclear how active this project is. On the documentation side I just find these .zip downloads but I could not find the installers that are mentioned to integrate with an existing 2.7 installation Python. >> >> So is this dying? Will you share with me why you are using this rather than IronPython? >> >> I hope this doesn't sound harsh. I think these kinds of efforts are fantastic. >> >> Thanks, >> >> Kenny >> >> _________________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From riscy00 at gmail.com Thu May 17 15:01:36 2012 From: riscy00 at gmail.com (riscy00) Date: Thu, 17 May 2012 06:01:36 -0700 (PDT) Subject: [Python.NET] IronPython Embeddied .NET 4.0, how to transfer object from C# into Ironpython and back again Message-ID: <1337259696472-4974924.post@n6.nabble.com> I'm learning more about data/object transfer between C# and ironpython (under embedded within NET4) I have class object instance containing Dictionary implementation with data such as "XDATA:67, YDATA:12,ZDATA:66" I also have test.py filename which is loaded into C#'s IRONPYTHON (using var and dynamic method). I was curious how to transfer data within the class object into Python (reference class or a copy?) which do various processing (ie ZDATA=YDATA+XDATA) and then return result within the same class (rather than value) Is this possible, if so please demonstrate code example in C# and python. How to make sure both Dictionary within C# is the same as python? The whole aim is to pass object instance into python and do operation task using object data and then pass data back into class and make it available to return object back to the C# for further processing. I wondered if this can this be done by mean of reference (rather than copy?, faster and more compact this way perhaps). -- View this message in context: http://python.6.n6.nabble.com/IronPython-Embeddied-NET-4-0-how-to-transfer-object-from-C-into-Ironpython-and-back-again-tp4974924.html Sent from the Python - pythondotnet mailing list archive at Nabble.com. From riscy00 at gmail.com Thu May 17 20:33:25 2012 From: riscy00 at gmail.com (riscy00) Date: Thu, 17 May 2012 11:33:25 -0700 (PDT) Subject: [Python.NET] IronPython Embeddied .NET 4.0, how to transfer object from C# into Ironpython and back again In-Reply-To: <1337259696472-4974924.post@n6.nabble.com> References: <1337259696472-4974924.post@n6.nabble.com> Message-ID: <1337279605826-4974958.post@n6.nabble.com> In addition, as an example for LIST basis (rather than Dictionary for which I primary interested once I get hang of the below.... In Python ======================================================= class Pointer(object): #class definition def __init__(self, alist, index): self.alist = alist self.index = index def get(self): # get return self.alist[self.index] def set(self, value): # set self.alist[self.index] = value def find(q): return Pointer(q, 0) def Process(): list1 = [1, 2, 3] #list object p = find(list1) #this create instance of the Pointer object with p as reference and then implement list value p.set(0) #Modify the list value on index 0 return list1 ===================================================================== I also have C# .NET4 with embedded python In C# ===================================================================== private void btnRun2_Click(object sender, EventArgs e) { // C# Side var runtime = Python.CreateRuntime(); dynamic test = runtime.UseFile(m_sFilename); // filename point to test.py (above code) var result = test.Process(); rtbConsole.Text += result.ToString(); } ======================================================================= Under debug, I can see result containing the list element 1,2,3 (with data)...which is great. (a) How to pass the LIST in C# to python (b) How to pass the LIST back to C# after python calculation routine. (c) How to make return result into LIST from the above.... Your input would be appreciated. -- View this message in context: http://python.6.n6.nabble.com/IronPython-Embeddied-NET-4-0-how-to-transfer-object-from-C-into-Ironpython-and-back-again-tp4974924p4974958.html Sent from the Python - pythondotnet mailing list archive at Nabble.com. From Kenny_Koller at bio-rad.com Fri May 18 23:33:13 2012 From: Kenny_Koller at bio-rad.com (Kenny Koller) Date: Fri, 18 May 2012 14:33:13 -0700 Subject: [Python.NET] Passing by reference Message-ID: An HTML attachment was scrubbed... URL: From brian.d.lloyd at gmail.com Sat May 19 04:21:23 2012 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Fri, 18 May 2012 22:21:23 -0400 Subject: [Python.NET] Passing by reference In-Reply-To: References: Message-ID: Hi Kenny - take a look at the unit tests at: http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/trunk/pythonnet/src/tests/test_method.py?revision=140&view=markup There are few tests there that demonstrate out and ref params. Short answer is that methods that return void and take an out param will return the out param. Methods that return a value and take out params return a tuple of the form (retval, outparam1, outparam2...). - Brian On Fri, May 18, 2012 at 5:33 PM, Kenny Koller wrote: > Hi Everyone, > > I'm continuing my work with the MCC USB-Quad08. So importing the > DLL/assembly was pretty straight forward (it's pretty much the same as > IronPython). But how do pass arguments by reference? > > For instance I want to call this method: > > public MccDaq.ErrorInfo CIn(int > counterNum, out ushort count) > > > Thanks, > > Kenny > > _________________________________________________ > 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 M.Schulte-Oversohl at pragmatis.de Thu May 31 19:18:41 2012 From: M.Schulte-Oversohl at pragmatis.de (Manfred Schulte-Oversohl) Date: Thu, 31 May 2012 17:18:41 -0000 Subject: [Python.NET] DataGridView Issue Message-ID: With Ironpython 2.7 the following code works. Not so with python for .Net where only a blank Form is displayed. Used python for .Net is compiled from trunk of May 26, 2012 python 2.6 and clr4. Any help is appreciated. Cheers Manfred #------------------------- import clr clr.AddReference('System.Windows.Forms') clr.AddReference('System.Drawing') import System.Windows.Forms as WinForms import System from System.Drawing import Size, Point SAMPLE_DATA = [ ('Joe', 23), ('Bob', 8), ('Thomas', 32), ('Patrick', 41), ('Kathy', 19), ('Sue', 77), ] class Person(System.Object): def __init__(self, name, age): self.Name = name self.Age = age people = [] for name, age in SAMPLE_DATA: people.append(Person(name, age)) f=WinForms.Form() f.Text = u"DataGridView From Python" h = WinForms.SystemInformation.CaptionHeight fdgv=WinForms.DataGridView() fdgv.AutoSize = True fdgv.Dock = WinForms.DockStyle.Fill fdgv.DataSource = people fdgv.Refresh() f.Controls.Add(fdgv) WinForms.Application.Run(f) -------------- next part -------------- An HTML attachment was scrubbed... URL: