On 3/28/06, ivan Uemlianin <[EMAIL PROTECTED]> wrote: > Dear All > > I'm interested in accessing .net dlls from python (e.g. to write test > scripts). Is pythonnet the correct software to use?
Definitely. > I have had a go. I have installed pythonnet and tested it with some of > the code samples: all well. Putting a .net dll called foo.dll in the > current directory, 'import foo' raises the following error: > > ImportError: dynamic module does not define init function (initfoo) To Brad: I think it could be nice idea to write custom import that will load .net dll automatically. I will see what can I do. The main question is how to behave with top level namespaces. > Is there a liitle bit extra I need to do, or am I barking up the wrong > tree? I suppose I'm looking for something that will allow me to import > .net dlls as if they were python modules. I could be wrong, but it seems to me that before importing something from .net dlls, you should load them first. import CLR from CLR.System.Reflection import Assembly my_dll_name = Assembly.LoadWithPartialName( path to dll that does not include .dll extension ) #import namespaces from CLR import TopNamespace > Any advice much appreciated. I hope this was helpful. > Best wishes > > Ivan -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ _________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet