Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'python': 0.09; 'path)': 0.09; 'sep': 0.09; 'underlying': 0.09; 'library': 0.15; '"from': 0.16; '"import': 0.16; 'dll.': 0.16; 'help?': 0.16; 'jerry': 0.16; 'structure.': 0.16; 'subject:Accessing': 0.16; 'subject:dll': 0.16; 'tried:': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'version.': 0.17; 'examples': 0.18; 'written': 0.20; 'trying': 0.21; 'import': 0.21; 'ctypes': 0.22; 'permitted': 0.22; 'recognize': 0.22; 'help.': 0.22; 'allows': 0.25; 'header:In- Reply-To:1': 0.25; 'am,': 0.27; 'dll': 0.27; 'module.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'correct': 0.28; 'actual': 0.28; 'run': 0.28; 'things,': 0.29; 'error': 0.30; 'compatible': 0.30; 'helpful': 0.30; 'url:python': 0.32; 'received:209.85.160.46': 0.32; 'running': 0.32; 'platform,': 0.33; 'to:addr:python-list': 0.33; 'requirements': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'help': 0.40; 'your': 0.60; 'share': 0.61; 'telling': 0.61; 'here:': 0.62; 'provide': 0.62; 'information': 0.63; 'more': 0.63; 'gave': 0.65; 'started.': 0.65; 'wish': 0.70; 'novice': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=k1Fe9V1E9cgRXtp9dDhKKRaY8ud3KlDuNjrSmJsOUN4=; b=aYBxBNJxJBHB7BZEaYJgm/WvAVuIMRM/O8zXTrmxLN6XIR3AIzuUcf96xYuaZmb3sN QIPdR8E6+aV5vzdccZ5fP9pHb9sXzy6Uyk5ngVnv22WEkwPFS6jtNtkGPnPJexchUiK1 NAYwSPlRRcRe8/PS1NbSdHeJk25g6AuhHMnF0eYEnlxk7GOmP95ZafGpXbWYXsczImU4 I3i23zsnz9DM0K5VXAhAgCxOiObKRsMnQbByJKDussV7H7M6dXjE6efzNqEm/ys2J2WY cLENuX6tut4HTwO3EFOnZQNnznFR9UHcagz5hio0NGauvlAmZYulnjZRxyP2O5NjJvQm GWUA== MIME-Version: 1.0 In-Reply-To: <0e642403-36e9-4945-9efb-4d074d7d0eb2@s5g2000vbj.googlegroups.com> References: <0e642403-36e9-4945-9efb-4d074d7d0eb2@s5g2000vbj.googlegroups.com> Date: Thu, 6 Sep 2012 11:30:27 -0400 Subject: Re: Accessing dll From: Jerry Hill To: python-list@python.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346945430 news.xs4all.nl 6854 [2001:888:2000:d::a6]:49621 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28610 On Thu, Sep 6, 2012 at 11:07 AM, Helpful person 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