Accessing dll

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Thu Sep 6 11:28:09 EDT 2012


Am 06.09.2012 17:07, schrieb Helpful person:
> I am a complete novice to Python.

Welcome!

> I wish to access a dll that has
> been written to be compatible with C and VB6.  I have been told that
> after running Python I should enter  "from ctypes import *" which
> allows Python to recognize the dll structure.  I have placed the dll
> into my active directory (if that's the correct word, one on my path)
> for simplification.

Using ctypes, you can indeed load DLLs. Take a look at 
http://docs.python.org, which includes the documentation for the ctypes 
module but also general documentation and tutorials, which should be a 
starting point for you.

> I tried:   "import name.dll" but this just gave me an error telling me
> that there was no such module.

Like in VB or C, things are not that easy. You will always have to write 
some code that informs Python about the names and parameters of the 
functions in that DLL.

Good luck!

Uli




More information about the Python-list mailing list