Pyhton:configparser针对配置文档读、写、移除
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"))
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。