Pyhton:configparser针对配置文档读、写、移除
导读:本文共313字符,通常情况下阅读需要1分钟。同时您也可以点击右侧朗读,来听本文内容。按键盘←(左) →(右) 方向键可以翻页。
摘要: import configparserconf = configparser.ConfigParser()conf.read('example.ini')print(conf.defaults())print(conf['bitbucket.org']['user'])print(conf.sections())sec = conf.remove_secti... ...
音频解说
目录
(为您整理了一些要点),点击可以直达。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"))
本文:
Pyhton:configparser针对配置文档读、写、移除的详细内容,希望对您有所帮助,信息来源于网络。