tôi sử dụng web.py viết trang web helloworld nhỏ, nhưng khi tôi chạy python code.py
tôi nhận được một thông báo lỗi:Web.py - AttributeError: 'module' đối tượng không có thuộc tính 'ứng dụng'
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'
Đây là của tôi mã (dán từ hướng dẫn của 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: Phiên bản web.py là 0,35.
có nghĩa là mô-đun web của tôi xung đột với Web.py?Nhưng tôi không thể tìm thấy web.py :( – Xhinking
Bạn có \ _ \ _ init \ _ \ _. Py trong webpy \ web \? – Nix
Có, tôi có __init__.py trong webpy \ web \ – Xhinking