Pyhton:configparser针对配置文档读、写、移除(configparser,文档读,配置,编程语言)

时间:2024-04-29 05:11:20 作者 : 石家庄SEO 分类 : 编程语言
  • TAG :

    Pyhton%EF%BC%9Aconfigparser%E9%92%88%E5%AF%B9%E9%85%8D%E7%BD%AE%E6%96%87%E6%A1%A3%E8%AF%BB%E3%80%81%E5%86%99%E3%80%81%E7%A7%BB%E9%99%A4

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针对配置文档读、写、移除的详细内容,希望对您有所帮助,信息来源于网络。
上一篇:Python正则表达式初识(六)下一篇:

7 人围观 / 0 条评论 ↓快速评论↓

(必须)

(必须,保密)

阿狸1 阿狸2 阿狸3 阿狸4 阿狸5 阿狸6 阿狸7 阿狸8 阿狸9 阿狸10 阿狸11 阿狸12 阿狸13 阿狸14 阿狸15 阿狸16 阿狸17 阿狸18