[IronPython] Transparent import of dlls?
m.schaber at 3s-software.com
Tue Mar 29 16:50:43 CEST 2011
Von: Jeff Hardy [mailto:jdhardy at gmail.com]:
> > We're currently using IronPython 2.6 in a hosted .NET 2 environment.
> For ipy.exe, there's a special directory called 'DLLs' that it reads
> startup and does the hosting equivalent of clr.AddReference for each
> in the folder. That's about the best you can do right now.
That DLLs directory seems to be a way which we can follow in our own
The disadvantage is that all DLLs are read, whether they're imported, or
> I've been thinking of adding support for .ipyd files (similar to
> .pyd files), which could handle this case, but haven't thought it
My suggestion is: "import foo" searches for a foo.ipyd (which basically
is a renamed foo.dll) in the search path, and can use both pyc-compiled
and handcrafted dlls.
Our use-case is to re-implement the API of 3rd-party native cPython
modules (like pysvn in my case) in C#. This should work as a drop-in
solution - drop the .dll in some appropriate place, and "import pysvn"
works without any changes in the actual application.
More information about the Ironpython-users