1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| from configparser import ConfigParser
''' ;config.ini [DEFAULT] ServerAliveInterval = 45 Compression = yes CompressionLevel = 9 ForwardX11 = yes ''' cfg = ConfigParser()
cfg.read('config.ini', encoding="utf-8") cfg.sections()
cfg.get('DEFAULT', 'ServerAliveInterval') cfg.get('DEFAULT', 'Compression') cfg.get('DEFAULT', 'CompressionLevel') cfg.get('DEFAULT', 'ForwardX11')
|