这是我的示例脚本:
import ConfigParser
config = ConfigParser.ConfigParser()
config.read('conf.ini')
print bool(config.get('main', 'some_boolean'))
print bool(config.get('main', 'some_other_boolean'))
这是conf.ini:
[main]
some_boolean: yes
some_other_boolean: no
运行脚本时,它会打印True两次。为什么?应该是False,some_other_boolean设置为no。