Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; '16,': 0.03; 'subject:file': 0.07; 'separator.': 0.09; 'yet.': 0.13; 'comma': 0.16; 'yaml': 0.16; 'wrote:': 0.17; 'parse': 0.22; "haven't": 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'supported': 0.26; 'there.': 0.28; '+0100,': 0.29; 'fri,': 0.30; 'lists': 0.31; "skip:' 20": 0.32; 'to:addr:python-list': 0.33; 'list': 0.35; 'nov': 0.35; 'something': 0.35; 'charset:us-ascii': 0.36; 'enough': 0.36; 'subject:: ': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'think': 0.40; 'content- disposition:inline': 0.60; 'thomas': 0.62; 'configparser': 0.84; 'received:10.94': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-mainz.de; i=@uni-mainz.de; q=dns/txt; s=ironport; t=1353071520; x=1384607520; h=date:from:to:subject:message-id:references:mime-version: in-reply-to; bh=t5d/wUspYE15uZovEfRUzGvvmQoOCtj+pfQHsE2TSaM=; b=BnCqfTK5OiyO2xQ4W1HtFQ3JMFqM6LxNmSGew0WbyHFQ2kMk7hMA9lHe WH+cCgaZNcKz8xMhB9uKGURzIqk4R1mOtCQ5qs1e47wrq26dE3pP1zXbV S61TYmM297oYpYqBJZLrkxAAKdakX5kO5OQ0ahUeaiR5VNDa6hxMV8+qG 0=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEAGI6plAKXgZY/2dsb2JhbABEw26CHgEBBTpPCxgeEBQpIIgkvhaMM4FmgkZhA5V7AZBDgnCCGA Date: Fri, 16 Nov 2012 14:04:12 +0100 From: Thomas Bach To: Subject: Re: editing conf file References: <996a6d6c-fdb2-40a0-bd5c-ada2ba35af78@i2g2000pbi.googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [94.219.177.91] 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353071521 news.xs4all.nl 6846 [2001:888:2000:d::a6]:45652 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33436 On Fri, Nov 16, 2012 at 01:48:49PM +0100, chip9munk wrote: > configparser has four functions: get, getboolean, getfloat and getint. > > how do I get list from cfg file?! AFAIK you have to parse the list yourself. Something like my_list = [ s.strip() for s in cp.get('section', 'option').split(',') ] if you use a comma as a separator. Have a look at YAML if this is not enough for you, as I think lists are supported there. Haven't had a look myself though, yet. Regards, Thomas Bach.