IronPython vs. Python .NET

cschol picture cschol · Jul 23, 2009 · Viewed 66.6k times · Source

I want to access some .NET assemblies written in C# from Python code.

A little research showed I have two choices:

What are the trade-offs between both solutions?

Answer

Reed Copsey picture Reed Copsey · Jul 23, 2009

If you want to mainly base your code on the .NET framework, I'd highly recommend IronPython vs Python.NET. IronPython is pretty much native .NET - so it just works great when integrating with other .NET langauges.

Python.NET is good if you want to just integrate one or two components from .NET into a standard python application.

There are notable differences when using IronPython - but most of them are fairly subtle. Python.NET uses the standard CPython runtime, so this Wiki page is a relevant discussion of the differences between the two implementations. The largest differences occur in the cost of exceptions - so some of the standard python libraries don't perform as well in IronPython due to their implementation.