Pyhton:configparser针对配置文档读、写、移除
更新:HHH   时间:2023-1-7


import configparser

conf = configparser.ConfigParser()
conf.read('example.ini')
print(conf.defaults())
print(conf['bitbucket.org']['user'])
print(conf.sections())

sec = conf.remove_section('bitbucket.org') #移除
conf.write(open('example.ini', "w"))

返回编程语言教程...