configparser.sections()
configparser.sections() is a Python method in the Configparser Module category. Returns a list of sections (excluding DEFAULT). The syntax is configparser.sections(). Returns: List of section names. A typical example: config.sections() # ["database", "server", "logging"]. A close sibling is configparser.ConfigParser(), which creates a configuration file parser (like INI files). A close sibling is configparser.read(), which reads configuration from one or more files. A close sibling is configparser.options(), which returns a list of all option keys in a section. A close sibling is configparser.get(), which gets a value as a string from a section. More about this category: Configuration file parser — sections, options, get, getint, write. For a broader walkthrough, read the Configparser Module guide. Related Configparser Module entries: configparser.ConfigParser(), configparser.read(), configparser.options(), configparser.get(), configparser.getint(), configparser.getboolean(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.