from ConfigParser import RawConfigParser as rcp
if __name__ == "__main__":
cfg = rcp()
cfg.add_section("Info")
cfg.set("Info", "ImagePath", "f:/whu")
cfg.set("Info", "foo", "cd's information")
cfg.write(open("f:/Whu/try.ini","w"))
#
#[Info]
#imagepath = f:/whu
#foo = cd's information
本文章來至源碼世界 http://www.ymsky.net/views/35797.shtml