Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python': 0.09; 'happen.': 0.09; 'sep': 0.09; 'dll,': 0.16; 'experimented': 0.16; 'explicitly.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'jerry': 0.16; 'libc': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'subject:Accessing': 0.16; 'subject:dll': 0.16; 'wrote:': 0.17; 'thu,': 0.17; '>>>': 0.18; 'bit': 0.21; 'import': 0.21; 'ctypes': 0.22; 'recognize': 0.22; 'example': 0.23; 'this:': 0.23; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'dll': 0.27; 'module.': 0.27; '>>>>': 0.29; 'received:192.168.1.3': 0.29; 'helpful': 0.30; 'code': 0.31; 'could': 0.32; 'print': 0.32; 'to:addr:python-list': 0.33; 'pm,': 0.35; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'think': 0.40; 'first': 0.61; 'header:Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'lays': 0.84; 'reply-to:addr:python.org': 0.84; 'hill': 0.96 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=W6e6pGqk c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=lR6CHUT36vYA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=nZEwgBvcm08A:10 a=CjxXgO3LAAAA:8 a=GSrOtsFzDIVD-9tsf8EA:9 a=wPNLvfGTeEIA:10 a=rC2wZJ5BpNYA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Thu, 06 Sep 2012 18:17:58 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Accessing dll References: <0e642403-36e9-4945-9efb-4d074d7d0eb2@s5g2000vbj.googlegroups.com> <83536b03-64a5-4394-9d31-378b56f4fa27@x3g2000vbn.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346951874 news.xs4all.nl 6891 [2001:888:2000:d::a6]:44132 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28620 On 06/09/2012 17:58, Jerry Hill wrote: > On Thu, Sep 6, 2012 at 12:46 PM, Helpful person wrote: >> The reference might help if I could get Python to recognize the dll as >> a module. > > That's never going to happen. It's a DLL, not a python module. I > think the documentation lays that out pretty explicitly. Have you > experimented with the very first bit of example code in the > documentation? What do you get if you do the following at the > interactive interpreter? > >>>> from ctypes import * >>>> print windll. > Or this: >>> import ctypes >>> dll_path = ... >>> libc = ctypes.CDLL(dll_path) >>> dir(libc)