settings.cfg
[english] greeting = Hello [french] greeting = Bonjour [files] home = /usr/local bin = %(home)s/bin
test.py
python3 test.py
import configparser cfg = configparser.ConfigParser() cfg.read('settings.cfg') print(cfg) #<configparser.ConfigParser object at 0x10144fe80> print(cfg['french']) #<Section: french> print(cfg['french']['greeting']) #Bonjour print(cfg['files']['bin']) #/usr/local/bin