-
return open(r'1.html' , 'r').read()
查看全部 -
类似java查看全部
-
讲的很好,很简单易学。跟着一步步来,很快就能做出来了。查看全部
-
讲的很好,很简单易学。跟着一步步来,很快就能做出来了。感谢老师讲的很好,很简单易学。跟着一步步来,很快就能做出来了。感谢老师查看全部
-
请求获取: web.input() web.ctx.env()查看全部
-
web 请求处理查看全部
-
web.py项目里的静态文件只能放在static目录下,否则访问不到。查看全部
-
python3安装web.py各种报错,如:ImportError: No module named ‘utils’ ModuleNotFoundError: No module named ‘db’等等。 解决方案如下: pip install web.py==0.40.dev0查看全部
-
/index:完全匹配 /post/\d+:模糊匹配 /post/(\d+):带组匹配查看全部
-
#coding: utf-8 import web urls = ( '/index', 'Index', '/blog/\d+', 'Blog', '/(.*)', 'Hello' ) app = web.application(urls, globals()) class Index: def GET(self): query = web.input() return query class Blog: def POST(self): data = web.input() return data class Hello: def GET(self, name): return open(r'1.html').read() if __name__ == "__main__": app.run() <html> <head> <title>Hello</title> </head> <body> <form action="/blog/123" method="post"> username:<input type="text" name="username" value=""/> password:<input type="password" name="password" value=""/> <input type="submit" value="submit"> </form> </body> </html>查看全部
-
import web urls = ( '/index', 'Index', '/blog/\d+', 'Blog', '/(.*)', 'Hello' ) app = web.application(urls, globals()) class Index: def GET(self): return 'Index Method' class Blog: def GET(self): return 'Blog Method' def POST(self): return 'Blog post Method' class Hello: def GET(self, name): return 'Hello ' + name if __name__ == "__main__": app.run()查看全部
-
<html> <head> <title>Hello</title> <script> function show_text(id, text){ document.getElementById(id).innerHTML = text; } function show_color(id, color){ document.getElementById(id).style.color = color; } </script> <style> #ll {width: 200px; font-size:40px;} </style> </head> <body> <label id="ll">test</label> <div> <a href="javascript:void(0);" onclick='javascript:show_text("ll", "My First JavaScript");'>My First JavaScript</a><br> <a href="javascript:void(0);" onclick='javascript:show_text("ll", "Hello python")'>Hello python</a><br> <a href="javascript:void(0);" onclick='javascript:show_color("ll", "#f00")'>red</a><br> <a href="javascript:void(0);" onclick='javascript:show_color("ll", "#0f0")'>green</a><br> </div> </body> </html> import web urls = ( '/(.*)', 'hello' ) app = web.application(urls, globals()) class hello: def GET(self, name): return open(r'1.html', 'r').read() if __name__ == "__main__": app.run()查看全部
-
本节的笔记,经过小五老师的热心指导,我们一定要抓住她的那个它,非常感谢小五老师!查看全部
-
请求参数的获取查看全部
-
request line 请求行 response line 回应行查看全部
举报
0/150
提交
取消