Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'warnings': 0.03; 'subject:Python': 0.05; 'python': 0.09; 'command-line': 0.09; 'fetch': 0.09; 'integers': 0.09; 'it;': 0.09; 'cases': 0.15; 'dec': 0.15; "(it's": 0.16; '24,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'zero,': 0.16; 'wrote:': 0.17; 'odd': 0.17; '>>>': 0.18; '(or': 0.18; 'windows': 0.19; 'feb': 0.19; 'error.': 0.21; 'terminate': 0.22; 'universal': 0.22; 'apps': 0.23; 'errors': 0.23; 'header:In-Reply-To:1': 0.25; 'skip:" 20': 0.26; 'am,': 0.27; 'ibm': 0.27; 'message- id:@mail.gmail.com': 0.27; 'chris': 0.28; 'succeed': 0.29; 'error': 0.30; 'code': 0.31; 'could': 0.32; 'raising': 0.33; 'to:addr:python-list': 0.33; 'that,': 0.34; "can't": 0.34; 'received:google.com': 0.34; 'wrong': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'michael': 0.36; 'but': 0.36; 'too': 0.36; 'operating': 0.36; 'unable': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'positive': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'think': 0.40; 'success,': 0.62; 'success': 0.63; 'skip:n 10': 0.63; 'more': 0.63; 'sounds': 0.71; '100': 0.78; '2013': 0.84; 'empire': 0.84; 'notion': 0.84; 'dennis': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=hM8FhNTsKEFkutRvKw0rgzfw+8r1eibpestREVBramE=; b=fRfgY//6nyTXfYk1G+mHIDMTVw7FAo70VSrmi3RR8/JJvZHsI2MjmdwRbm3qOo5cDV aqwGozmFnKBkeuGdcK7QZFUS+IqkNLzXi0PC7BFpy3D7CToLGu4+JYnKo8YhSwiFWdrY 1O7Ywg3wuGgXu/eRg1PC3duLspXE8HBalQnvrXls7HIi/ZGMn7+bTWBGxqOwIWg6g+Jb Ya8mGD3qr+oJnfu8k1s2hnjQu3qe390YJId5MUx3CPZpqvti2KZO1ptIe7D85Ombjr+z yhrrWJ2+ayn0hCftx6JxK06fj/g31h6M/NCK59WdePVjyRYVXpw2pPbLmFOEsv/l+hIW kQJw== MIME-Version: 1.0 X-Received: by 10.220.223.80 with SMTP id ij16mr7997237vcb.28.1361661493803; Sat, 23 Feb 2013 15:18:13 -0800 (PST) In-Reply-To: <5129482F.3080402@gmail.com> References: <5127848B.1060004@gmail.com> <928d2cf7-728b-4f35-b8c9-4c9b958507e5@googlegroups.com> <8eadd52c-d533-4333-8c7f-7bf3a6d7b046@googlegroups.com> <9p1ii899tkalvfd1cl7sneoqa9t1cqh4oj@invalid.netcom.com> <5129482F.3080402@gmail.com> Date: Sun, 24 Feb 2013 10:18:13 +1100 Subject: Re: Python Newbie From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361661496 news.xs4all.nl 6922 [2001:888:2000:d::a6]:51884 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39721 On Sun, Feb 24, 2013 at 9:52 AM, Michael Torrie wrote: > On 02/23/2013 02:38 PM, Chris Angelico wrote: >> On Sun, Feb 24, 2013 at 5:29 AM, Dennis Lee Bieber >> wrote: >>> Error codes under DEC VAX/VMS used odd integers for >>> "success/information" and even integers for "warning/error" (been too >>> many years, I think positive integers were success/warning, negative >>> integers were information/error; I could also be wrong on which set were >>> even... if 0 were no-info/success then odd were errors and even were >>> success)). >> >> Sounds like IBM DB2 and sqlca.sqlcode - 0 for success, <0 for error, >>> 0 for warning (or in some cases "status" - an SQLCODE of 100 means >> "end of result set", which isn't exactly an error but you can't fetch >> any more from it; it's akin to Python raising StopIteration to >> terminate a for loop). > > All apps that return an error code to the operating system return 0 for > success, any other value for error. All command-line utilities work > this way, all shells, etc. Even Windows command-line apps work this way > (errorlevel is what they call it). Yep, the 0 = success part is pretty much universal (it's been said that the cause of the downfall of the Roman empire was that, lacking zero, they were unable to succeed at anything), but the notion of negative for errors and positive for warnings isn't as clear; errorlevels and Unix return codes are positive-only. ChrisA