标签:style blog color io for ar cti div
# !/usr/bin/python # Filename:tcfg.py import ConfigParser config = ConfigParser.ConfigParser() config.read("/home/xxx/xxx/tcfg.ini") print secs = config.sections() print ‘secs=‘,secs #secs= [‘Config‘] opts = config.options("Config") print ‘option = ‘,opts#option = [‘svn‘, ‘pwd‘, ‘root‘, ‘ip‘] kvs = config.items(secs[0]) print ‘kvs=‘,kvs#kvs= [(‘svn‘, ‘/home/xxx/wo/relate_platform/controller‘), (‘pwd‘, ‘11111‘), (‘root‘, ‘root‘), (‘ip‘, ‘10.10.10.XX‘)] svn = config.get(secs[0],"svn") ip = config.get(secs[0],"ip") print print ‘svn=‘,svn print ‘ip=‘,ip
ConfigParser---python,布布扣,bubuko.com
标签:style blog color io for ar cti div
原文地址:http://www.cnblogs.com/dot-dot-123/p/3919195.html