# coding=utf-8
import configparser
cong=configparser.ConfigParser()
cong.read("new",encoding="utf-8")
# cong.add_section("section3")#添加一个节点
# cong.add_section("section1")
# cong.write(open("new","a"))#
#
cong.remove_section("section3")#删除一个节点,删除之前要先读取该文件,
# cong.write(open("new","w+"))
cong.set("section1","val1","123")#更改指定节点下指定的建和值
#cong.set("section3","valu1","456")
cong.remove_option("section1","s1")#删除指定节点下的指定建
cong.write(open("new","w"))