Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31773

Re: section with in a section config file and reading that config file

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: section with in a section config file and reading that config file
Date 2012-10-19 17:46 -0400
Organization > Bestiaria Support Staff <
References <b5307867-0aa6-49db-b58d-803850a60d2d@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.2536.1350683236.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, 19 Oct 2012 02:51:13 -0700 (PDT), kampy
<narasimha18sv@gmail.com> declaimed the following in
gmane.comp.python.general:

> 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

INI file structure (which I believe the config file follows) does not
support hierarchical sections. What you CAN do is something like:

[TopLevels]
topsections=AAA, DDD

[AAA]
sections=BBB, CCC

[BBB]
a=1
b=1

[CCC]
a=1
b=2

[DDD]
sections=EEE

[EEE]
a=3
b=4

	In other words, YOU have to define the nesting hierarchy by
specifying keys that identify the sections in the next level down.

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

section with in a section config file and reading that config file kampy <narasimha18sv@gmail.com> - 2012-10-19 02:51 -0700
  Re: section with in a section config file and reading that config file Tarek Ziadé <tarek@ziade.org> - 2012-10-19 12:09 +0200
    Re: section with in a section config file and reading that config file narasimha18sv@gmail.com - 2012-10-19 03:22 -0700
      Re: section with in a section config file and reading that config file Tarek Ziadé <tarek@ziade.org> - 2012-10-19 15:57 +0200
        Re: section with in a section config file and reading that config file rusi <rustompmody@gmail.com> - 2012-10-19 07:26 -0700
    Re: section with in a section config file and reading that config file narasimha18sv@gmail.com - 2012-10-19 03:22 -0700
    Re: section with in a section config file and reading that config file Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-19 21:29 +0000
      Re: section with in a section config file and reading that config file Tarek Ziadé <tarek@ziade.org> - 2012-10-19 23:59 +0200
        Re: section with in a section config file and reading that config file Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-19 22:59 +0000
  Re: section with in a section config file and reading that config file Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-19 17:46 -0400

csiph-web