Difficult-Rocket/tests/config_file_check.py
2021-10-30 20:19:12 +08:00

27 lines
525 B
Python

import configparser
configs = configparser.ConfigParser()
configs.read('test_config.config')
# print(configs.sections())
back = {}
for c in configs.sections():
back[c] = {}
for con in configs[c]:
back[c][con] = configs[c][c]
# name = configs[c][con]
# print(c, con, name)
print('ree')
b = {}
for c in configs:
print(c)
b[c] = configs[c]
# print(configs['a'])
print('ree')
conf = configparser.ConfigParser()
# conf.read('test_config.config')
# print(type(conf))
print(back)
print(b)