Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!newsfeed101.telia.com!starscream.dk.telia.net!news.tele.dk!news.tele.dk!small.news.tele.dk!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python': 0.09; 'command- line': 0.09; 'literal': 0.09; 'whatever.': 0.09; 'file,': 0.15; 'assignments': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'importable': 0.16; 'parameters,': 0.16; 'podcast': 0.16; 'simplest': 0.16; 'settings': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'config': 0.17; 'import': 0.21; 'host': 0.24; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'entries': 0.27; 'message-id:@mail.gmail.com': 0.27; 'there.': 0.28; 'decide': 0.28; 'agreed.': 0.29; "d'aprano": 0.29; 'gather': 0.29; 'steven': 0.29; 'generally': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'things': 0.38; 'there,': 0.38; 'to:addr:python.org': 0.39; 'application': 0.40; 'skip:" 10': 0.40; 'think': 0.40; 'your': 0.60; 'easy': 0.60; 'subject: & ': 0.67; '2013': 0.84; 'start.': 0.84 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=M8mPkuE7tm6g48l46luNWQUgN8oIGCLXzEQW0RK8tI8=; b=jN8KdlQqleIRIHxAvOK8jGA4RIKQyPWghDOQVgzRC63d0WRx6z4ZzfkInmCADA3RoI 32O6F5YPSC0qzxY23lxD3n9CwLJn4MuXsnrxNfy3dWml7oqLlOQ5KEU50nuYkLUoRU4i lljHkHEb7BujVAgsrbrJqAArTeae7d22hC3tfF6Tto792KkkSHN/5nI+noG9MT1f6Ib5 ugbeQYwr3EDVfkrXBkIL6eXn53Z6XsAs3OleATNlT5D+y5gkgg9IiTJ85QB0Zuw8jRV4 AYm7l2c2dALNQKn+4Z512lUNHQoZ5+jtwYiDzzZkBL003pZCRAMfksOdoGYSn9CEBNW5 ulSg== MIME-Version: 1.0 X-Received: by 10.52.22.194 with SMTP id g2mr9452207vdf.91.1362542718953; Tue, 05 Mar 2013 20:05:18 -0800 (PST) In-Reply-To: <5136b87c$0$30001$c3e8da3$5496439d@news.astraweb.com> References: <61520ad1-9e3c-4eec-b1d9-8a9d8fc7bf0c@googlegroups.com> <5136b87c$0$30001$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 6 Mar 2013 15:05:18 +1100 Subject: Re: Config & ConfigParser 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362542728 news.xs4all.nl 6900 [2001:888:2000:d::a6]:52530 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40600 On Wed, Mar 6, 2013 at 2:31 PM, Steven D'Aprano wrote: > What configuration settings does your podcast catcher software need? What > makes you think it needs any? Don't over-engineer your application from > the start. Begin with the simplest thing that works, and go from there. Agreed. The way I generally do these things is to simply gather the config entries into a block of literal assignments at the top of the program: host = "ftp" port = 21 proxy = "192.168.0.3:81" user = "transfers" password = "secret" >From there, it's easy to decide whether to make them into command-line parameters, a parseable config file, an importable Python script ("from config import *" is an easy and simple way to make that one), or whatever. ChrisA