![]() May be treated as parts of multiline values or ignored.īy default, a valid section name can be any string that does not contain ‘\n’. Depending on the parser’s mode, blank lines Values can also span multiple lines, as long as they are indented deeper In which case the key/value delimiter may also be left Values can be omitted if the parser is configured to allow it , Leading and trailing whitespace is removed from keys and values. By default, section names are case sensitive but keys are not getboolean ( 'BatchMode', fallback = True ) False Supported INI File Structure ¶Ī configuration file consists of sections, each led by a header,įollowed by key/value entries separated by a specific string ( = or : byĭefault ). getboolean ( 'BatchMode', fallback = True ) True > config = 'no' > topsecret. ![]() > 'BatchMode' in topsecret False > topsecret. 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. 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 () > 'forge.example' in config True > '' in config False > config 'hg' > config 'yes' > topsecret = config > topsecret 'no' > topsecret '50022' > for key in config. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |