http://docs.python.org/library/configparser.html” rel=“nofollow” ConfigParser:
[Ticket]
description = This is a multiline string.
1
2
4
5
7
如For ConfigParser examples所述,这里的助手职能是:
def ConfigSectionMap(section):
dict1 = {}
options = Config.options(section)
for option in options:
try:
dict1[option] = Config.get(section, option)
if dict1[option] == -1:
DebugPrint("skip: %s" % option)
except:
print("exception on %s!" % option)
dict1[option] = None
return dict1
由此产生的价值是:
>>> print ConfigSectionMap( Ticket )[ description ]
This is a multiline string.
1
2
4
5
7
预期价值为:
>>> print ConfigSectionMap( Ticket )[ description ]
This is a multiline string.
1
2
4
5
7
我如何确定这一点?