# That being said, this can be customized. # Inline comments can be harmful because they prevent users # from using the delimiting characters as parts of values. key = value spaces in keys = allowed spaces in values = allowed as well spaces around the delimiter = obviously you can also use : to delimit keys from values values like this: 1000000 or this: 3.14159265359 are they treated as numbers? : no integers, floats and booleans are held as: strings can use the API to get converted values directly: true chorus: I'm a lumberjack, and I'm okay I sleep all night and I work all day key_without_value empty string value here = # like this or this # By default only in an empty line. Any conflicting keys are taken from the more recentĬonfiguration while the previously existing keys are retained.
It is possible to read several configurations into a singleĬonfigParser, where the most recently added configuration has the Note also that keys in sections areĬase-insensitive and stored in lowercase 1. Involves the DEFAULT section which provides default values for all other print ( key ) user compressionlevel serveraliveinterval compression forwardx11 > config 'yes'Īs we can see above, the API is pretty straightforward. sections () > '' in config True > '' in config False > config 'hg' > config 'yes' > topsecret = config > topsecret 'no' > topsecret '50022' > for key in config.