aboutsummaryrefslogblamecommitdiff
blob: 7f8e2f04549082efceb7d27fbdf43b53a4de4b6d (plain) (tree)



























                                                      
# https://docs.python.org/3/library/configparser.html

# import configparser
# config = configparser.ConfigParser()
# config['DEFAULT'] = {'ServerAliveInterval': '45',
#                      'Compression': 'yes',
#                      'CompressionLevel': '9'}
# config['forge.example'] = {}
# config['forge.example']['User'] = 'hg'
# config['topsecret.server.example'] = {}
# topsecret = config['topsecret.server.example']
# topsecret['Port'] = '50022'     # mutates the parser
# topsecret['ForwardX11'] = 'no'  # same here
# config['DEFAULT']['ForwardX11'] = 'yes'
# with open('example.ini', 'w') as configfile:
#   config.write(configfile)

# config = configparser.ConfigParser()
# config.sections()
# config.read('example.ini')
# config.sections()
# topsecret = config['topsecret.server.example']
# topsecret['ForwardX11']
# topsecret['Port']
# for key in config['forge.example']:  
#     print(key)

# config['forge.example']['ForwardX11']
Powered by cgit v1.2.3 (git 2.41.0)