Previous topic


Next topic


This Page


NepidemiXConfigParser.get(section, option, default=None, add_if_not_existing=True, dtype=<type 'str'>)

Get a value from an option in a section. Ability to cast to a specific data type; return a default value if the option does not exist, as well as adding the value to the config.

Parameters :

section :str :

The config section.

option : str

The config option.

default : special, optional

If None an exception will be raised if option does not exist. If not None, the value of default will be returned and no exception raised. Default - None.

add_if_not_existing : bool, optional

If this is True, the option does not exist and` default` != None, the option will be created and set to the value of default.

dtype : special

The read string will be cast to this data type. Default str.

Returns :

val : special

The value of option casted to dtype.