Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:using': 0.09; 'subject:Help': 0.11; 'thread': 0.14; 'python/c': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'subject:ctypes': 0.16; '(you': 0.16; 'properly': 0.19; 'example': 0.22; 'header:User- Agent:1': 0.23; 'handling': 0.26; 'least': 0.26; 'skip:" 20': 0.27; 'header:X-Complaints-To:1': 0.27; 'code': 0.31; 'boundary': 0.31; 'writes:': 0.31; 'subject:with': 0.35; 'charset:us-ascii': 0.36; 'too': 0.37; 'e.g.': 0.38; 'to:addr:python-list': 0.38; 'environment.': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:217': 0.63; 'great': 0.65 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: dieter Subject: Re: Help with implementing callback functions using ctypes Date: Thu, 09 May 2013 07:54:57 +0200 References: <8931a89c-0d00-4c8b-ba19-cf683d8d266d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e0a6df.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:i/JoFeCsFsnJvoLPQ3N9Wxxze8s= 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368078919 news.xs4all.nl 15885 [2001:888:2000:d::a6]:49487 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45006 jamadagni writes: > ... I cannot help you with "ctypes". But, if you might be able to use "cython", then calling callbacks is not too difficult (you can find an example in e.g. my "dm.xmlsec.binding"). Note, however, that properly handling the GIL ("Global Interpreter Lock") may be of great importance when the Python/C boundary is crossed -- at least when you intend to use your code in a multi thread environment.