草庐IT

NoSectionError

全部标签

Python ConfigParser.NoSectionError : No section:

我不断收到ConfigParser.NoSectionError:Nosection:'file'错误我的配置文件如下:[file]api_access_id=123445567api_default_org=NAMEapi_secret_key=kjvhkd28unfkjsapi_base_url=www.fakeurl.com/api我的代码如下:config=ConfigParser.RawConfigParser()configFilePath='E:\Python\configfile\test.txt'config.read(configFilePath)try:api_a

Python 2.4.3 : ConfigParser. NoSectionError:无节: 'formatters'

尝试使用日志配置文件来实现TimedRotatinigFileHandler。只是因为某种原因不接受配置文件。任何建议表示赞赏。x.py:importloggingimportlogging.configimportlogging.handlerslogging.config.fileConfig("x.ini")MyLog=logging.getLogger('x')MyLog.debug('Starting')x.ini:[loggers]keys=root[logger_root]level=NOTSEThandlers=trfhand[handlers]keys=trfhand