Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Marc Brooks Newsgroups: comp.lang.python Subject: Re: i'm a python newbie & wrote my first script, can someone critique it? Date: Fri, 10 Jun 2016 20:51:01 -0400 Lines: 30 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de SwNuECKdOUBT+sNM2gdp5QR2zFYopJBzOFsGulWUMTYw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'cc:addr :python-list': 0.09; 'subject:script': 0.09; 'received:209.85.218': 0.10; 'python': 0.10; 'subject:python': 0.14; '2016': 0.16; 'basic.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'scientist': 0.16; 'url:pep-0008': 0.16; 'wrote:': 0.16; '>': 0.18; 'email addr:gmail.com>': 0.18; 'cc:addr:python.org': 0.20; 'cc:2**1': 0.22; 'cc:no real name:2**0': 0.22; 'cc:addr:gmail.com': 0.24; 'header:In-Reply- To:1': 0.24; 'wondering': 0.25; 'chris': 0.26; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'cap': 0.29; 'marc': 0.29; 'pep': 0.29; 'url:peps': 0.29; 'comments': 0.30; 'url:mailman': 0.30; 'work.': 0.30; 'code': 0.30; "i'd": 0.31; 'url:python': 0.33; 'done,': 0.33; 'lock': 0.33; 'url:listinfo': 0.34; 'structure': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'url:dev': 0.35; 'but': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'things': 0.38; 'received:209': 0.38; 'delete': 0.38; 'url:mail': 0.40; 'your': 0.60; 'iphone': 0.63; 'better.': 0.66; 'subject: & ': 0.74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Nuffd8tgRszXEJ8O1ylOB8BvhU7u6cEVyggrdEbjLK8=; b=qRgB7G9k1SyCpwad1JC2l7DCkPiD+Wc0kDYiQ+nwe2QGl4z2U7wbTj7wFDSA08KOal 0LBM1wyKNHftpxBI1oYRuWFFb5VqnSyvB8eCN3zw3iII6SN0uuRA5DfesXByK7wsPqDm hfrRgBb0cwkkZSafUlYXoFQZ0lIBoXLHRj8mJWaCL3YcKWXDz3MaOuJecU4zSULXLM7Z oDt1oMinnOkWF28bwqwaFl579gKXUOSFOTNAHPO33kQWKQOLj/uatIbaBwptvN29LpNb ZLiK4vb/eDEmHKDxCGYmw+ZRjVariPad2Fw9sgpSjouFtqW+5xzj+0b/K86GP43tonyA 7W/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Nuffd8tgRszXEJ8O1ylOB8BvhU7u6cEVyggrdEbjLK8=; b=Va5Z409YlVwh1iiIEFMXK1fD0BuCDkfUIKMtlKmWgLCGHdFOp5mYRZ/P4lgxsJwKFn hhdSEaCC2bLn5NYTg6faFA4bP3CNyij9wrU5paOwNRASQjRhv5ZSOdHZKiQWKrrlMyBk olKQ7HjfUys5Nc/NQu07Bsne+WZUNdXUUvRaQYBb0F/HCwBrUIrBrJUvP/fqT1GyGmPw c8jQQVMMdTFJmJNPkhMdzwikkpUVDWQqOlSPFnE8ZMrbBAopR8Fnxrjp9iaJtoMMy3CT HXWP1ZlPS29OqRGYMeVGNTRTNYd3mqJFACaGvu5Wvh2fuTAs1cKenidW18vjIOnP7lXo MrPw== X-Gm-Message-State: ALyK8tIyxTezAaP11HBA8dGZoXclED0nR+TCCpL/RCDE+yDUR8a+Tib0V352/UWme6YVtdnJro30PghfsvplQA== X-Received: by 10.202.80.85 with SMTP id e82mr2046432oib.47.1465606262292; Fri, 10 Jun 2016 17:51:02 -0700 (PDT) In-Reply-To: X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com comp.lang.python:109806 The structure of your program is really not that Pythonic. I'd recommend you take a look at PEP 8. https://www.python.org/dev/peps/pep-0008/ It's not perfect, but it's a good start to get a feel for how to structure your Python work. Marc On Fri, Jun 10, 2016 at 7:05 PM, Christopher Reimer < christopher_reimer@icloud.com> wrote: > > > Sent from my iPhone > > > On Jun 10, 2016, at 3:52 PM, mad scientist jr < > mad.scientist.jr@gmail.com> wrote: > > . > > Now that it's done, I am wondering what kind of things I could do better. > > This is Python, not BASIC. Lay off on the CAP LOCK key and delete all the > comments and separation blocks. No one is going to find your code in all > that noise. > > Chris R. > -- > https://mail.python.org/mailman/listinfo/python-list >