我在http://www.ibm.com/developerworks/opensource/library/os-cherrypy/?ca=dgr-lnxw01CherryPy
#!/usr/bin/env python
import cherrypy
from cherrypy import cpg
class Application:
@cpg.expose
def hello(self, what='Hello', who='world'):
return '%s, %s!' % (what, who)
cpg.root = Application()
cpg.server.start()
但我认为该网站已经老了,我的python版本是2.7.3。
错误是
Traceback (most recent call last):
File "hello4.py", line 3, in <module>
from cherrypy import cpg
ImportError: cannot import name cpg
安装该计划的樱桃http://sourceforge.net/apps/trac/xenwebmanager/wiki/GettingStarted
新版本的python发生了什么变化?
如何更改为python 2.7.3使用项目?