我使用 web.py 编写小型 helloworld 站点,但运行时python code.py
出现错误消息:
Traceback (most recent call last): File "E:\Python25\webpy\web\mysite.py", line 1, in <module>
import web File "E:\Python25\webpy\web\web.py", line 4, in <module>
app = web.application(urls, globals()) AttributeError: 'module' object has no attribute 'application'
这是我的代码(从 web.py 的教程中粘贴):
import web
urls = ( '/','Index',
)
class Index:
def GET(self):
return "Hello,world!"
app=web.application(urls,globals())
if __name__=="__main__":
app.run(
PS:web.py 版本为 0.35。