综合了几篇文章
https://www.jianshu.com/p/4f50ce352b2f
https://www.cnblogs.com/shellshell/p/6947049.html
https://blog.csdn.net/weixin_42174361/article/details/82873878
configparser和ConfigParser在python中用来读取ini类型的配置文件的,提供很多方便的API来使用。
- configparser: 在python3中的包名
- ConfigParser:在python2中的包名
# 服务器配置信息
[server]
test_server = "10.1.1.5"
dev_server = "10.1.2.5"
pro_server = "10.1.1.5"
= 亦可为 :
其中server代表section,我理解为组。
然后下面的test_server...键被称为option。
而option对应的=后面的值为value。
其他看文本开头第二篇链接
详细使用看第三篇链接