Using .NET from within Python on win32? Is python.net viable?

464 views Asked by At

I'm trying to write a quick and dirty little program to poll a WASP-B ANT+ to wifi gateway on windows, using python (the language I'm most familiar with). The WASP-B device has an unpublished UDP protocol that is mixed up with NDA's and so forth, but they have a published .NET library for win32 programming. So ... I googled around a bit and found IronPython and python.NET. If I understand correctly, IronPython is a .NET application or something? Not really what I'm after, I just want to be able to use the "stuff" in the WASP-B's .NET library from within a python program, so I think python.NET is the better option for me.

As far as I can tell, python.NET isn't all that active though - does anyone here know if it's live, if it'll work with current (3.x) python on Windows and if I'm on the right track?

On sourceforge, python.NET hasn't been touched since Jan 2013 :

http://sourceforge.net/projects/pythonnet/

The WASP, for anyone interested :

http://www.npe-inc.com/products/products-wasp.html

2

There are 2 answers

0
B.K. On BEST ANSWER

If you're looking for a Python variant that plays very well with .NET, then I highly suggest Iron Python: http://ironpython.net/ it is an open-source variant of Python that was integrated with the .NET framework, allowing it to behave similarly to one of the .NET-friendly languages.

As far as being active, the last update was made on May 25, 2014, which is pretty recent. The updates are not frequent, but for the most part there is no need for them, beyond some improvements and fixes. I would suggest giving it a try and see if it works for you. It's hard to answer a question of something being the right thing for the job unless youn give it a try.

0
den.run.ai On

IronPython works wells within .NET environments (calling .NET assemblies). If you stay within .NET framework then IronPython is recommended. Note Python 3 port is in progress and the syntax is not supported yet (Jan 2015).

But CPython (main Python implementation) works well with Python.NET both for extending and embedding. The reason for using CPython with Python.NET is if you need libraries that call Python C-API (not supported by IronPython), like Numpy, Scipy, Pandas, Cython, Matplotlib, etc. Python 3 port is here:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

https://github.com/renshawbay/pythonnet/