Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.086 X-Spam-Evidence: '*H*': 0.83; '*S*': 0.00; 'scripts': 0.03; 'wiki': 0.03; 'subject:Error': 0.07; 'python': 0.11; 'article.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'handling,': 0.16; 'problem!': 0.16; 'exception': 0.16; 'language': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'seems': 0.21; 'command': 0.22; 'programming': 0.22; 'error': 0.23; 'url:moin': 0.24; 'together.': 0.24; 'script': 0.25; 'handling': 0.26; 'posts': 0.26; 'post': 0.26; 'world,': 0.26; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'fastest': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'lines': 0.31; 'that.': 0.31; 'url:wiki': 0.31; 'catching': 0.31; 'operations.': 0.31; 'terminate': 0.31; 'run': 0.32; 'quite': 0.32; 'worked': 0.33; 'url:python': 0.33; 'advice': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'really': 0.36; 'are,': 0.36; 'url:org': 0.36; 'thank': 0.38; 'filter': 0.38; 'saves': 0.38; 'solving': 0.38; 'handle': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'how': 0.40; 'even': 0.60; 'read': 0.60; 'easy': 0.60; 'most': 0.60; 'hope': 0.61; 'first': 0.61; 'here:': 0.62; "you'll": 0.62; 'happen': 0.63; 'more': 0.64; 'different': 0.65; 'great': 0.65; '20,': 0.68; 'line,': 0.68; 'person,': 0.68; 'computers': 0.72; 'boys': 0.84; 'subject:Testing': 0.84; 'works!': 0.91; 'scott': 0.93; 'more!': 0.95; '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:to :content-type:content-transfer-encoding; bh=+npUUanHZRw03NGyxqI4maQyOWMUYomQBiLIVJxY3p0=; b=UpKS2Y/h8rrYrV4ZLgf1U7BGZLRRAKNip6Bw2B8KuRJG9waMd1LxIQXKLYqDa6MmKk eSxjhQmijjGfvm/L2Pd1nA8wA5H2i6jcHqH5ELlztUDa8dTi2Wo8xbA9x2Q+ct04hUsj 9S7WAlDM1gd26+W3ZV0lbOgfKFQTR+Rh29LlL01SDVquB4ilehYEDbMkq2taQxvqI4ki iZ6Oq3aN1kCYfASXkbfzFuXhZiASOuuyWFMtzRQUEMSMiqyJs/IzDk0pyXFsLrks/GBL xL/VdRMbfjXCKJckvqMmxUA3PCbEP8tYJeCWDKtcFvU1FQx/Q/F34Ejp1R65IwBys6/x W2xw== MIME-Version: 1.0 X-Received: by 10.68.101.225 with SMTP id fj1mr8305105pbb.8.1382190133559; Sat, 19 Oct 2013 06:42:13 -0700 (PDT) In-Reply-To: References: <33549834-2f27-47f3-abea-eb3486909dec@googlegroups.com> Date: Sun, 20 Oct 2013 00:42:13 +1100 Subject: Re: Error Testing From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382190142 news.xs4all.nl 15872 [2001:888:2000:d::a6]:44025 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57103 On Sun, Oct 20, 2013 at 12:34 AM, Scott Novinger wro= te: > I read the link on Handling Exceptions. The first bit of code worked for= my purposes. I was able to reduce my number of lines of code significantly= and my program works! Thank you all for your help solving this problem! As you get accustomed to exception handling, you'll find that it's a really clean and easy way to... well, handle exceptional situations :) Tip: In quick throw-away scripts that are run from the command line, don't even bother catching most exceptions. Just let 'em happen if they want to happen... your script will terminate with an error message, and you can deal with it as a human. That saves you even more code! > My plan is to create several different programs that perform specific Alg= ebraic operations. My boys are learning Algebra 2 and I thought it might b= e a fun way to help us all learn Algebra and programming together. Python = seems to be a good language for learning how to program. It is an excellent language for that. It's also a great language for applications. It may not be the fastest in the world, but all computers wait at the same speed anyway... Just one thing: When you post here, please either don't use Google Groups, or follow the advice here: https://wiki.python.org/moin/GoogleGroupsPython Preferably, just avoid GG, as a number of people just filter those posts out. It's not an indictment of you as a person, but the majority of GG posts are, quite frankly, very annoying for the reasons set out in the wiki article. Hope to see you around more! ChrisA