ID EN
Config Parser

read

Python 3.11

Attempt to read and parse an iterable of filenames, returning a list of filenames which were successfully parsed.

Syntax

PYTHON
read(filenames, encoding=None)

Examples

Example 1
PYTHON
import configparser, os

config = configparser.ConfigParser()
config.read_file(open('defaults.cfg'))
config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],
            encoding='cp1250')

See Also

bytes path-like object ConfigParser read_file() read() open() path-like object bytes