I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for.
Could you write an app in it? or is it for adding a scripting language to your app?
How do you guys use it?
IronPython works as an extension to the . NET Framework, but it can also be used by . NET projects to take advantage of Python's scripting power. Other than that, since IronPython is a real implementation of Python itself, there's no need to learn a new language or extra features if you already know Python.
One of the largest benefits of IronPython is that it has (effectively) no GIL - meaning that if you are both writing Python code and it is multi-threaded - you can often get performance that is better than CPython without having to spawn multiple process and pickle objects across the boundaries.
IronPython. Just as Jython is an implementation of Python on the JVM, IronPython is an implementation of Python on the . Net runtime, or CLR (Common Language Runtime). IronPython uses the DLR (Dynamic Language Runtime) of the CLR to allow Python programs to run with the same degree of dynamism that they do in CPython.
IronPython is an open-source implementation of the Python programming language which is tightly integrated with . NET. IronPython can use . NET and Python libraries, and other .
Either or both :)
I wouldn't claim to know a specific "purpose" for IronPython but it certainly can be used to write applications, and it can be used for scripting within a larger .NET application.
Aside from anything else, it's a handy way of gently easing Python developers into the world of .NET. (Why not learn C# at the same time? Come on in, the water's lovely...)
The biggest benefit of IronPython is that it brings the worlds of Python and .NET very close together.
If you have libraries (assemblies) written in C# you can import those directly into IronPython and use them, like this:
import clr clr.AddReferenceToFileAndPath('MyAssembly.dll') import MyNamespace c = MyNamespace.MyClass() c.MyFunction()
This is very nice for reusing exisiting .NET code when scripting or even interactive use with the IronPython interpreter.
Ordinary CPython requires Python .NET to do the same or similar things. In my experience, Python .NET works most of the time, but not always and IronPython provides a much more polished experience in accessing .NET from Python.
IronPython will probably always lag the reference implementation of CPython in terms of standard library support etc., but in general the development is not that far behind, that it would hard to work with coming from a CPython background.
Lastly, there are a few substantial differences between CPython and IronPython, to which, one should pay attention. Example - garbage collection (bit me the other day...).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With