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


Groups > comp.lang.python > #37256

Re: handling return codes from CTYPES

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin1!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <square.steve@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.039
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'chunk': 0.07; 'parameter': 0.07; 'variable,': 0.07; 'python': 0.09; 'booth': 0.09; 'garbage': 0.09; 'steve': 0.13; 'received:209.85.161.174': 0.16; 'set,': 0.16; 'subject:handling': 0.16; 'wrote:': 0.17; 'working.': 0.17; '(all': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'looks': 0.26; 'wondering': 0.26; 'objects': 0.29; "i'm": 0.29; 'function': 0.30; 'expect': 0.31; 'code': 0.31; 'url:python': 0.32; 'to:addr:python-list': 0.33; 'languages': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'received:209.85': 0.35; 'but': 0.36; 'message-id:@gmail.com': 0.36; 'url:org': 0.36; 'url:library': 0.36; "i'll": 0.36; 'thank': 0.36; 'turn': 0.36; 'why': 0.37; 'previous': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'think': 0.40; 'skip:u 10': 0.60; 'you.': 0.61; 'spending': 0.61; 'love': 0.63; 'header:Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'reply-to:addr:gmail.com': 0.79; 'mike,': 0.84; '"it': 0.91; 'ages': 0.91; 'forgotten': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:reply-to:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=CoxK7L4/i3oBPhC0UkVx0QYWAa2LNWUNUdudXsKqYqk=; b=UDqBukR+/+eOXfKcEK6ly3I9XyixqlzYRyrszogyk4v4Xw3ShG+b9DdZdGRfRwVFkv guq9gVwFPYlZafiRgcuSqNerYPXGyrjTXxn398Y1YqUJ/pXTc+m0N9Z+NRVab9FWtaPz zR1QLfkSfE6BqvNxZt47Le795jhvRLvBlIQi8Zc5ZdqK5ZFQT6hMdApTuQyQa2S9VPpx 5idkdlJJFgBrTmPO/WDdqv+PdvnDLRdNTghcJ7TVSHHWmo4qIh0a85JjARDhXSz58p2P t6ouLkt6ywjim8ZobAZxgYlwNs/gzPud1bGo3r7HBOHxZFIUXx7AY4yJazLkgoVZgV2H FFJQ==
X-Received by 10.236.81.198 with SMTP id m46mr23736598yhe.129.1358841775623; Tue, 22 Jan 2013 00:02:55 -0800 (PST)
Date Tue, 22 Jan 2013 08:02:51 +0000
From Steve Simmons <square.steve@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: handling return codes from CTYPES
References <mailman.736.1358765181.2939.python-list@python.org> <XnsA14F71C8BA4D1duncanbooth@127.0.0.1>
In-Reply-To <XnsA14F71C8BA4D1duncanbooth@127.0.0.1>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Cc duncan.booth@suttoncourtenay.org.uk
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To square.steve@gmail.com
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.780.1358845215.2939.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1358845215 news.xs4all.nl 6958 [2001:888:2000:d::a6]:49052
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:37256

Show key headers only | View raw


Duncan, Mike, MRAB,

Thank you.  New technology set, same forgotten lesson - RTFM (all of it!).

Thanks also for the clarification on discarding objects and Garbage 
Collection.  Looks like I'll have to turn a large chunk of my previous 
understanding of (mainframe) languages 'inside out'.

I'm just wondering how often I'll have to chant "it isn't a variable, 
it's a name bound to an object" before I can write a chunk of code 
without spending ages pondering why it isn't working.

I already like Python for its clean design but I think it'll be a while 
before I love it completely.

Steve

On 21/01/2013 11:11, Duncan Booth wrote:
> Tell the function what type to return before you call it: InitScanLib
> = sLib.InitScanLib InitScanLib.restype = c_short See
> http://docs.python.org/2/library/ctypes.html#return-types You can also
> tell it what parameter types to expect which will make calling it
> simpler.

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


Thread

handling return codes from CTYPES Steve Simmons <square.steve@gmail.com> - 2013-01-21 10:46 +0000
  Re: handling return codes from CTYPES Duncan Booth <duncan.booth@invalid.invalid> - 2013-01-21 11:11 +0000
    Re: handling return codes from CTYPES Steve Simmons <square.steve@gmail.com> - 2013-01-22 08:02 +0000
    Re: handling return codes from CTYPES Chris Angelico <rosuav@gmail.com> - 2013-01-23 00:10 +1100

csiph-web