Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python, ConfigParser: What is 'magical interpolation'

The documentation for ConfigParser in Python talks a lot about the so-called "magical interpolation" feature, but never explains what it actually does. I've tried searching for it, but haven't found any answers.

like image 342
Eskil Avatar asked Jul 05 '10 15:07

Eskil


People also ask

What does Configparser do in Python?

The configparser module from Python's standard library defines functionality for reading and writing configuration files as used by Microsoft Windows OS. Such files usually have . INI extension.

Is Configparser built in Python?

configparser comes from Python 3 and as such it works well with Unicode. The library is generally cleaned up in terms of internal data storage and reading/writing files.

How do I read a .ini file in Python?

Python File: # Read file and and create if it not exists config = iniFile( 'FILE. INI' ) # Get "default_path" config. default_path # Print (string)/path/name print config. default_path # Create or Update config.


1 Answers

bad_subj below would be parsed into 'Notify [failure]'

bad_subj: %(subj)s [failure]
subj: Notify
like image 62
SilentGhost Avatar answered Nov 10 '22 15:11

SilentGhost