我用web.py寫的小的HelloWorld網站,但是當我運行python code.py
我得到一個錯誤信息:Web.py - AttributeError的:「模塊」對象有沒有屬性「應用」
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。
你的意思是我的網頁模塊與Web.py相沖突但是我找不到我的web.py :( – Xhinking
你在webpy \ web \?中有\ _ \ _init \ _ \ _。py嗎? – Nix
是的,我在webpy \ web \ – Xhinking