Discussion:
[Python.NET] Using a managed private DLL in python for .NET‏
Jorn Vanloofsvelt
2012-04-04 14:34:52 UTC
Permalink
Dear Brian

My question is very short, and I hope that the answer is simple but I have not been able to find an answer on the web.

I am using python for .NET, I want to use a private managed DLL. My code looks as follows:

import clr
from clr import System

clr.AddReference("OneWireAPI")

That works, however I am unable to get the namespace or its classes. How am I supposed to do this?
I figured "from clr import namespace", but that didn't work. I have also tried Assembly.LoadFromFile()

Here is an example of usage of this DLL:
http://files.maxim-ic.com/sia_bu/softdev/owdocs_400beta2/Docs/OW.NET/OW.NET_Primer.html

Greetings
Jorn
Brian Lloyd
2012-04-06 15:55:38 UTC
Permalink
What is the top level namespace exported by that assembly? Assuming it was
'OneWire' you
should be able to do:

import clr
clr.addReference("OneWireAPI")
import OneWire
...

Hope this helps!

- Brian
Post by Jorn Vanloofsvelt
Dear Brian
My question is very short, and I hope that the answer is simple but I have
not been able to find an answer on the web.
import clr
from clr import System
clr.AddReference("OneWireAPI")
That works, however I am unable to get the namespace or its classes. How
am I supposed to do this?
I figured "from clr import namespace", but that didn't work. I have also
tried Assembly.LoadFromFile()
http://files.maxim-ic.com/sia_bu/softdev/owdocs_400beta2/Docs/OW.NET/OW.NET_Primer.html
Greetings
Jorn
_________________________________________________
http://mail.python.org/mailman/listinfo/pythondotnet
--
Brian Lloyd
brian.d.lloyd-***@public.gmane.org
(c) 540.845.2975
Barton
2012-04-07 23:27:47 UTC
Permalink
import clr
clr.AddReference("OneWireAPI")
import OneWireAPI as OW
# Now you may access the classes, etc on the library
# Have fun with that!

NOTE: I haven't tried this.
# OneWireContainer enumeration
for owc in OW.getAllDeviceContainers():
print owc.getDescription ()
Post by Jorn Vanloofsvelt
Dear Brian
My question is very short, and I hope that the answer is simple but I
have not been able to find an answer on the web.
import clr
from clr import System
clr.AddReference("OneWireAPI")
That works, however I am unable to get the namespace or its classes. How
am I supposed to do this?
I figured "from clr import namespace", but that didn't work. I have also
tried Assembly.LoadFromFile()
http://files.maxim-ic.com/sia_bu/softdev/owdocs_400beta2/Docs/OW.NET/OW.NET_Primer.html
Greetings
Jorn
_________________________________________________
http://mail.python.org/mailman/listinfo/pythondotnet
_________________________________________________
Python.NET mailing list - PythonDotNet-+ZN9ApsXKcEdnm+***@public.gmane.org
http://mail.python.org/mailman/listinfo/pythondotnet

Loading...