Accessing dll

Jerry Hill malaclypse2 at gmail.com
Thu Sep 6 11:30:27 EDT 2012


On Thu, Sep 6, 2012 at 11:07 AM, Helpful person <rrllff at yahoo.com> wrote:
> I am a complete novice to Python.  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.
>
> I tried:   "import name.dll" but this just gave me an error telling me
> that there was no such module.
>
> Can someone please help?

You should start by reading the ctypes documentation, here:
http://docs.python.org/library/ctypes.html .  It has a lot of examples
that ought to get you started.

When you run into more specific problems, you're going to have to
provide a lot more information before we can help you, including the
specific documentation of the DLL you're trying to wrap, your
platform, and python version.  If you are not permitted to share those
things, we may not be able to give you much help.  Ctypes is very
specific to the actual library you are accessing, and requires that
you understand the requirements of the underlying DLL.

-- 
Jerry



More information about the Python-list mailing list