通过本文主要向大家介绍了python configparser,python中configparser,python3 configparser,configparser模块,configparser等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
测试配置文件test.conf内容如下:
[second]
sw=4
test: hello
</div>
测试配置文件中有两个区域,first和second,另外故意添加一些空格、换行。
下面解析:
获得每个区域的属性值:
输出:
好了,以上就是基本的使用过程,下面是动态的写入配置,
上面是向test2.ini写入配置信息。
</div>
