Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'parser': 0.07; 'subject:file': 0.07; 'tarek': 0.07; 'ex:': 0.09; 'logic': 0.09; 'received:internal': 0.09; 'from:name:tarek ziad\xe9': 0.16; 'other:': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:mail.srv.osa': 0.16; 'received:messagingengine.com': 0.16; 'received:nyi.mail.srv.osa': 0.16; 'received:osa': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'received:srv.osa': 0.16; 'subject: \n ': 0.16; 'wrote:': 0.17; 'config': 0.17; 'parameters': 0.20; 'all,': 0.21; 'bit': 0.21; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'values': 0.26; 'am,': 0.27; 'file': 0.32; 'structure': 0.32; 'could': 0.32; 'to:addr:python-list': 0.33; 'add': 0.36; 'subject:with': 0.36; 'subject:: ': 0.38; 'received:10': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'help': 0.40; 'skip:u 10': 0.60; 'link': 0.60; 'back': 0.62; 'configparser': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=eweQNsRP+6jnFwJlieWNU5 t6FSU=; b=V8QEOILVPKpOFB0OMD8+ZOYF40WKont68kGQCTMaiNgQzYwozV9ElE Q9BMQkMgCBBwS2x8dKIbS4FS419obGr9eWPYym8HXoS3sNAD89Tkm9HM1fv3oNec N7Kf0sxqEMQe1KaexKrKzXMNaO/1GnVcB+6ZBqSs5IJNUYWS5yy5g= X-Sasl-enc: g9omEyB06V2efXFv25nxc4z1CapUoYIVpc+ZqdHD1cFH 1350641394 Date: Fri, 19 Oct 2012 12:09:53 +0200 From: =?ISO-8859-1?Q?Tarek_Ziad=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: section with in a section config file and reading that config file References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350641397 news.xs4all.nl 6900 [2001:888:2000:d::a6]:57174 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31729 On 10/19/12 11:51 AM, kampy wrote: > hi all, > my requirement is to have section with in a section in config parameters > ex: > [AAA] > [BBB] > a=1 > b=1 > [CCC] > a=1 > b=2 > Any one help me in understanding how to make sure that config file to have a structure like this and reading with the config parser a configuration file is a flat sequences of sections, you cannot do this what you could do is have 2 files, and add a link from one to the other: file1.ini: [AAA] extended = file2.ini file2.ini: [BBB] a=1 b=1 [CCC] a=1 b=2 then create a bit of logic on the top of ConfigParser to read back those values HTH Tarek