On this page
  1. configparser.BasicInterpolation
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

configparser.BasicInterpolation

Up: configparser | Next: configparser.ConfigParser
Rel: configparser.ConfigParser, configparser.ConverterMapping, configparser.DuplicateOptionError, configparser.DuplicateSectionError
Ref: docs.python.org — configparser.BasicInterpolation
Tags: #public #python3 #stdlib #configparser


Import

import configparser
from configparser import BasicInterpolation

Signature & Overview

configparser.BasicInterpolation()

Interpolation as implemented in the classic ConfigParser.

Methods & Attributes

Usage

import configparser

cp = configparser.ConfigParser(interpolation=configparser.BasicInterpolation())
cp.read_string("[paths]\nbase=/opt\nbin=%(base)s/bin\n")
assert cp["paths"]["bin"] == "/opt/bin"

Gotchas

REPL Inspect

from configparser import BasicInterpolation
help(BasicInterpolation)

Linked from

Related notes