读取conf中的内容
app.conf
[/] tools.gzip.on: True [googleapi] key = "..." appid = "..."
test.py
class Root(object): @cherrypy.expose def index(self): google_appid = cherrypy.request.app.config['googleapi']['appid'] return "hello world!" cherrypy.quickstart(Root(), '/', "app.conf")