Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28616

Re: Accessing dll

From Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com>
Newsgroups comp.lang.python
Subject Re: Accessing dll
Date 2012-09-06 17:28 +0200
Message-ID <91smh9-duc.ln1@satorlaser.homedns.org> (permalink)
References <0e642403-36e9-4945-9efb-4d074d7d0eb2@s5g2000vbj.googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Accessing dll Helpful person <rrllff@yahoo.com> - 2012-09-06 08:07 -0700
  Re: Accessing dll Jerry Hill <malaclypse2@gmail.com> - 2012-09-06 11:30 -0400
    Re: Accessing dll Helpful person <rrllff@yahoo.com> - 2012-09-06 08:41 -0700
    Re: Accessing dll Helpful person <rrllff@yahoo.com> - 2012-09-06 08:44 -0700
      Re: Accessing dll Chris Angelico <rosuav@gmail.com> - 2012-09-07 22:15 +1000
        Re: Accessing dll Helpful person <rrllff@yahoo.com> - 2012-09-07 10:27 -0700
          Re: Accessing dll Chris Angelico <rosuav@gmail.com> - 2012-09-08 21:21 +1000
    Re: Accessing dll Helpful person <rrllff@yahoo.com> - 2012-09-06 09:46 -0700
      Re: Accessing dll Jerry Hill <malaclypse2@gmail.com> - 2012-09-06 12:58 -0400
        Re: Accessing dll Helpful person <rrllff@yahoo.com> - 2012-09-06 10:10 -0700
      Re: Accessing dll MRAB <python@mrabarnett.plus.com> - 2012-09-06 18:17 +0100
  Re: Accessing dll Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-09-06 17:28 +0200
  Re: Accessing dll Tim Williams <tjandacw@cox.net> - 2012-09-06 13:21 -0700
    Re: Accessing dll Tim Williams <tjandacw@cox.net> - 2012-09-06 13:27 -0700

csiph-web