Is there a way to use .NET DLL from Python

Christian Heimes lists at cheimes.de
Thu Feb 7 10:55:48 EST 2008


Luis M. González wrote:
> Oh, I know what you mean.
> But that was exactly the reason for having a .DLLs folder, isn't it?
> When you place an assembly into this folder, you avoid having to write
> this boilerplate code, and simply import the assembly as you would
> with a normal python module. At least, that´s how it worked in
> previous versions...

In IronPython and with PythonDotNET you can import namespaces. Assembly
names and name spaces don't have to be related. E.g. ClassLibrary1.dll
may provide the namespace ClassLibA and ClassLibB.
clr.AddReference('ClassLibrary1') loads the assembly 'ClassLibrary1' and
makes all namespaces available to Python.

Christian




More information about the Python-list mailing list