Python 使用 configparser
2020-02-29 python 956
from configparser import ConfigParser cf = ConfigParser() conf_file = "./data/conf.ini" cf.read(conf_file) cf.add_section("settings") cf.set("settings","username","manager") cf.set("settings","password","123456") with open(conf_file,"w",encoding="utf-8") as f: cf.write(f)
很赞哦! (0)
相关文章
文章评论
-
-
-
0条评论