Re: How to store properties

2017-02-22 Thread MRAB
On 2017-02-22 21:08, Gilmeh Serda wrote: On Wed, 08 Feb 2017 09:31:09 -0800, Rob Gaddi wrote: JSON's cute, but the format doesn't support inline comments. { "your_key": "whatever", "COMMENT": "blah", "meh": [ "yup", "yep", "yip" ], "COMMENT": "mooh"

Re: How to store properties

2017-02-09 Thread Chris Angelico
On Thu, Feb 9, 2017 at 7:43 PM, dieter wrote: > "pickle", too, has a potential security risk -- if you allow > unpickling from untrusted source. Usually, however, configuration > comes from trusted sources. Pickle's other downside is that it's an opaque binary file, unlike ConfigParser, JSON, and

Re: How to store properties

2017-02-09 Thread Cecil Westerhof
On Wednesday 8 Feb 2017 12:26 CET, Cecil Westerhof wrote: > In Java you (can) use a properties file store configuration. What is > the best way to do something like that in Python? > I saw ConfigParser, but have the feeling that it is not really used. > Would a JSON file be a good idea? Thanks f

Re: How to store properties

2017-02-09 Thread dieter
Cecil Westerhof writes: > ... >> If you only want to read the configuration, just use an ordinary >> file you import. For example config.py contains the lines: >> username=myuser >> server=myserver >> password=secret >> >> In your script: >> >> import config >> >> Now you can referenc all the var

Re: How to store properties

2017-02-08 Thread Terry Reedy
On 2/8/2017 6:26 AM, Cecil Westerhof wrote: In Java you (can) use a properties file store configuration. What is the best way to do something like that in Python? I saw ConfigParser, but have the feeling that it is not really used. IDLE uses it for default and user configuration files. -- Ter

Re: How to store properties

2017-02-08 Thread Cecil_Westerhof
From: Cecil Westerhof On Wednesday 8 Feb 2017 13:11 CET, Peter Heitzer wrote: > Cecil Westerhof wrote: >> In Java you (can) use a properties file store configuration. What >> is the best way to do something like that in Python? I saw >> ConfigParser, but have the feeling that it is not really

Re: How to store properties

2017-02-08 Thread Michael_Torrie
From: Michael Torrie On 02/08/2017 04:26 AM, Cecil Westerhof wrote: > In Java you (can) use a properties file store configuration. What is > the best way to do something like that in Python? > I saw ConfigParser, but have the feeling that it is not really used. > Would a JSON file be a good idea?

Re: How to store properties

2017-02-08 Thread Rob Gaddi
On 02/08/2017 03:26 AM, Cecil Westerhof wrote: In Java you (can) use a properties file store configuration. What is the best way to do something like that in Python? I saw ConfigParser, but have the feeling that it is not really used. Would a JSON file be a good idea? In the interest of trying

Re: How to store properties

2017-02-08 Thread Michael Torrie
On 02/08/2017 04:26 AM, Cecil Westerhof wrote: > In Java you (can) use a properties file store configuration. What is > the best way to do something like that in Python? > I saw ConfigParser, but have the feeling that it is not really used. > Would a JSON file be a good idea? I've used ConfigParse

Re: How to store properties

2017-02-08 Thread Neil Cerutti
On 2017-02-08, Cholo Lennon wrote: > On 02/08/2017 08:26 AM, Cecil Westerhof wrote: >> In Java you (can) use a properties file store configuration. >> What is the best way to do something like that in Python? I >> saw ConfigParser, but have the feeling that it is not really >> used. > > I use it a

Re: How to store properties

2017-02-08 Thread Cecil Westerhof
On Wednesday 8 Feb 2017 13:11 CET, Peter Heitzer wrote: > Cecil Westerhof wrote: >> In Java you (can) use a properties file store configuration. What >> is the best way to do something like that in Python? I saw >> ConfigParser, but have the feeling that it is not really used. >> Would a JSON fi

Re: How to store properties

2017-02-08 Thread David Palao
2017-02-08 13:34 GMT+01:00 Cholo Lennon : > On 02/08/2017 08:26 AM, Cecil Westerhof wrote: >> >> In Java you (can) use a properties file store configuration. What is >> the best way to do something like that in Python? >> I saw ConfigParser, but have the feeling that it is not really used. > > > I

Re: How to store properties

2017-02-08 Thread Cholo Lennon
On 02/08/2017 08:26 AM, Cecil Westerhof wrote: In Java you (can) use a properties file store configuration. What is the best way to do something like that in Python? I saw ConfigParser, but have the feeling that it is not really used. I use it a lot ;-) Would a JSON file be a good idea? -

Re: How to store properties

2017-02-08 Thread Peter Heitzer
Cecil Westerhof wrote: >In Java you (can) use a properties file store configuration. What is >the best way to do something like that in Python? >I saw ConfigParser, but have the feeling that it is not really used. >Would a JSON file be a good idea? If you only want to read the configuration, just

How to store properties

2017-02-08 Thread Cecil Westerhof
In Java you (can) use a properties file store configuration. What is the best way to do something like that in Python? I saw ConfigParser, but have the feeling that it is not really used. Would a JSON file be a good idea? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.c