ironpython Difference between Python and IronPython Using .Net assemblies from Python code


With IronPython you can access any .net assembly which is compiled using the same or a lower version than the IronPython core.

Example: Importing a a .net assembly and class

from System import Math

Example: Using an imported class:

from System import Math
print Math.Abs(-123)

You can also load additional assemblies by using the builtin clr module.

import clr
clr.AddReference('Sample') # Sample.dll inside of the working directory.

Than just use it as any other .net or python library.