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


Groups > comp.lang.python > #33439

Re: editing conf file

From chip9munk <"chip9munk[SSSpAm"@gmail.com>
Newsgroups comp.lang.python
Subject Re: editing conf file
Date 2012-11-16 14:28 +0100
Organization ARNES
Message-ID <k85f24$ihn$2@poprovec.arnes.si> (permalink)
References <k85a7i$sjn$1@poprovec.arnes.si> <k85aoe$uot$1@poprovec.arnes.si> <996a6d6c-fdb2-40a0-bd5c-ada2ba35af78@i2g2000pbi.googlegroups.com> <k85cnl$84o$1@poprovec.arnes.si> <mailman.3749.1353071521.27098.python-list@python.org>

Show all headers | View raw


On 11/16/2012 2:04 PM, Thomas Bach wrote:
> 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.

yes i guess this is needed, thanks!

> 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.
>

I will check it out!

Thank you!

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


Thread

editing conf file chip9munk <"chip9munk[SSSpAm"@gmail.com> - 2012-11-16 13:06 +0100
  Re: editing conf file chip9munk <"chip9munk[SSSpAm"@gmail.com> - 2012-11-16 13:15 +0100
    Re: editing conf file rusi <rustompmody@gmail.com> - 2012-11-16 04:35 -0800
      Re: editing conf file chip9munk <"chip9munk[SSSpAm"@gmail.com> - 2012-11-16 13:48 +0100
        Re: editing conf file Thomas Bach <thbach@students.uni-mainz.de> - 2012-11-16 14:04 +0100
          Re: editing conf file chip9munk <"chip9munk[SSSpAm"@gmail.com> - 2012-11-16 14:28 +0100
        Re: editing conf file Tim Chase <python.list@tim.thechases.com> - 2012-11-16 07:43 -0600
  Re: editing conf file Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-11-16 14:02 +0100
    Re: editing conf file chip9munk <"chip9munk[SSSpAm"@gmail.com> - 2012-11-16 14:27 +0100
      Re: editing conf file Roy Smith <roy@panix.com> - 2012-11-16 09:08 -0500
        Re: editing conf file rusi <rustompmody@gmail.com> - 2012-11-16 08:41 -0800

csiph-web