configparser

Edit ini file option values with ConfigParser (Python)

Anyone know how'd I'd go about editing ini file values preferably using ConfigParser? (Or even a place to start from would be great!) I've got lots of comments throughout my config file so I'd like to keep them by just editing the values, not taking the values and playing around with multiple files. Structure of my config file: [name1]...

Rename config.ini section using ConfigParser in python

Is there an easy way to rename a section in a config file using ConfigParser in python? I'd prefer not to have to delete the section and recreate it, but that is my only answer right now. ...

python configparser

How can I parse tags with no value on ini file with python configparser module? For example, I have the below ini and I need to parse rb. On some ini the rb have integer value and on some hasn't at all like below. How can I do that with configparser without getting a valueerror? I use getint function [section] person=name id=000 rb= ...

Python ConfigParser persist configuration to file

I have a configuration file (feedbar.cfg), having the following content: [last_session] last_position_x=10 last_position_y=10 After I run the following python script: #!/usr/bin/env python import pygtk import gtk import ConfigParser import os pygtk.require('2.0') class FeedbarConfig(): """ Configuration class for Feedbar. Used to...

Issue Replacing Already Existing Strings with ConfigParser

I am using ConfigParser to save simple settings to a .ini file, and one of these settings is a directory. Whenever I replace a directory string such as D:/Documents/Data, with a shorter directory string such as D:/, the remaining characters are placed two lines under the option. So the .ini file now looks like this: [Settings] director...

Can logging and CherryPy share the same config file?

Both the Python logging module and CherryPy's Config API use ConfigParser files. Therefore, I assumed that I could use one single config file for my own applications configuration, it's logging configuration, and CherryPy's configuration. When my logging and CherryPy were separate, they worked fine, and my config file does parse with n...

Storing and retrieving a list of Tuples using ConfigParser

I would like store some configuration data in a config file. Here's a sample section: [URLs] Google, www.google.com Hotmail, www.hotmail.com Yahoo, www.yahoo.com Is it possible to read this into a list of tuples using the ConfigParser module? If not, what do I use? ...

How to use ConfigParser with virtualenv?

I wrote a tool that looks in several places for an INI config file: in /usr/share, /usr/local/share, ~/.local/share, and in the current directory. c = ConfigParser.RawConfigParser() filenames = ['/usr/share/myconfig.conf', '/usr/local/share/myconfig.conf', os.path.expanduser('~/.local/share/myconfig.conf'), ...

Impossible to create a configuration file for an python application inside Google App Engine

I try to create a configuration file, where I can store constants. Whenever I try with ConfigParser, I get an error Traceback (most recent call last): File "/home/baun/google_appengine/google/appengine/ext/webapp /__init__.py", line 511, in __call__ handler.get(*groups) File "/home/baun/workspace/octopuscloud/s3/S3.py",...