[Python.NET] accessing .net dlls from python

Ivan Uemlianin i.uemlianin at bangor.ac.uk
Wed Mar 29 11:34:29 CEST 2006


Ivan Uemlianin wrote:

>Roman Yakovenko wrote:
>
>  
>
>>On 3/28/06, ivan Uemlianin <i.uemlianin at bangor.ac.uk> wrote:
>> 
>>
>>    
>>
>>>Is there a litle 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
>  
>

>1.  Installing Python for .NET as a standalone, and using it in the 
>interactive session, all of the above, apart from 'from CLR import 
>TopNamespace' works.  'from CLR import TopNamespace' gets 'ImportError: 
>cannot import name TopNamespace'. 
>  
>
Duh.  Of course I replace 'TopNamespace' with my own namespace.  Please 
regard this question as a typo.

Best

Ivan




More information about the PythonDotNet mailing list