Instantiate a ConfigSection object.
name is the name of the section.
data , if specified, is the dictionary of data to initalize the section contents with.
ConfigSection objects are rarely instantiated manually. They are generally created using the ConfigManager API (either the direct methods or the Python dictionary syntax).
dictionary that contains the option instances. This is only accessed if you want to retrieve the real option instances. Normally, you would use standard dictionary key access syntax on the section itself to retrieve the option values.
retrieve the value of option . Setting raw to true prevents any string interpolation from occurring in that value. vars is a dictionary of addition value to use when interpolating values into the option.
Note: You can alsouse the alternative dictionary syntax: section.get(option).
retrieve the value of an option. This method allows you to use Python’s dictionary syntax on a section as shown below.
# Print the value of the 'optionname' option print mysection['optionname']
create a new option or set an existing option with the name option and the value of value . If the given value is already an option instance, it is simply inserted into the section. If it is not an option instance, an appropriate type of option is chosen for the given type.
create a new option or set an existing option with the name key and the value of value . This method allows you to use Python’s dictionary syntax to set options as shown below.
# Create a new option called 'optionname' mysection['optionname'] = 10
return a string containing an INI file representation of the section. Options set from Python code are not included in this representation.