E:\python>python web.py
Traceback (most recent call last):
File "web.py", line 1, in <module>
import web
File "E:\python\web.py", line 6, in <module>
app = web.application(urls, globals())
AttributeError: 'module' object has no attribute 'application'
Traceback (most recent call last):
File "web.py", line 1, in <module>
import web
File "E:\python\web.py", line 6, in <module>
app = web.application(urls, globals())
AttributeError: 'module' object has no attribute 'application'
2017-04-25
已采纳回答 / 慕粉1404263948
HTTP协议支持四种请求方式,分别是 GET POST PUT DELETE,当浏览器发送 POST 请求的时候,web.py 就调用相应的 POST 方法。
2017-04-20
import web
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(self, name):
if not name:
name = 'World'
return 'Hello, ' + name + '!'
if __name__ == "__main__":
app.run()
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(self, name):
if not name:
name = 'World'
return 'Hello, ' + name + '!'
if __name__ == "__main__":
app.run()
2017-03-29
Traceback (most recent call last):
File "F:\Python\web.py", line 1, in <module>
import web
File "F:\Python\web.py", line 6, in <module>
app = web.application(urls, globals())
AttributeError: 'module' object has no attribute 'application'
File "F:\Python\web.py", line 1, in <module>
import web
File "F:\Python\web.py", line 6, in <module>
app = web.application(urls, globals())
AttributeError: 'module' object has no attribute 'application'
2017-03-23