AttributeError module object has no attribute application

新手上路,请多包涵

import web

urls = (

'/', 'index'

)

class index:

def GET(self):
    return "Hello, world!"

if name == "__main__":

app = web.application(urls, globals())
app.run()

以上为代码,有人曾提过这个问题,但我还是不明白该怎么解决。

阅读 3.3k
1 个回答

应该是命名冲突了,没有import正确的web模块。比如当前路径有web.py这个文件。

推荐问题