Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'syntax': 0.04; 'subject:using': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'finney': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'systemexit': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'code,': 0.22; 'cc:addr:python.org': 0.22; '2.x': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'compatible': 0.32; 'except': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'ben': 0.38; 'pm,': 0.38; 'new': 0.61; 'course': 0.61; 'subject:there': 0.68; 'as:': 0.81; 'to:none': 0.92; '2013': 0.98 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:cc :content-type; bh=u0pkTgzhCEyNu5tQGBZwP5sLoGtbC6tpXbPCvaqsiXs=; b=YxgSfDyZegeDCBnUrolHadt9vqvO6tsLdObJ6cOkBd7aNt0pQLriJrylsJF+XNaDi1 ytBL0OlXOkeDubn2E4oLV2eO92EmduDEOz+9qxpYSe+ND7xhH3sCCJhGhq9EYizqdUyt e3FJP3J1N/UEz2epGEXUrqTXdaoxSwrGWSYjAqlAe2UWwaGC1JBRNcINYkTgek4L1x2E ACDdOIvmmnAfGXJW/PR/MBYUN7V5Azq2LIsf+uCAEd9D4fu7g7cc0/HfncTQAFRLKbuV +Ut6SxtGmCsTSZUuj47XvNBpOL6V40zKyU5R9puUom0olISliVA0cF1UsBm41Uv89AOT 1b9Q== MIME-Version: 1.0 X-Received: by 10.68.111.33 with SMTP id if1mr764468pbb.31.1386758507199; Wed, 11 Dec 2013 02:41:47 -0800 (PST) In-Reply-To: <7wsitzlm3o.fsf@benfinney.id.au> References: <32615c9a-b983-4399-bb55-6df6c230f247@googlegroups.com> <7wsitzlm3o.fsf@benfinney.id.au> Date: Wed, 11 Dec 2013 21:41:47 +1100 Subject: Re: Is there any advantage to using a main() in python scripts? From: Chris Angelico Cc: "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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386758510 news.xs4all.nl 2971 [2001:888:2000:d::a6]:41163 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61546 On Wed, Dec 11, 2013 at 9:26 PM, Ben Finney wrote: > except SystemExit, exc: For new code, you'd of course want to write that as: except SystemExit as exc: which is compatible with Python 2.6, 2.7, and 3.x, while the other syntax is 2.x only. ChrisA