web.py – 网页跳转
来源:互联网 发布:spring boot sql脚本 编辑:程序博客网 时间:2024/06/05 06:11
代码实现:
import web
urls = ("/", "hello",
"/test.*","testn",
"/input1/(.+)/(.+)","input_test1",
"/ainput","input_test2"
)
app = web.application(urls, globals())
class hello:
def GET(self):
return"hello"
class testn:
def GET(self):
raiseweb.seeother('/input1/123/456')
#raiseweb.redirect('/input1/123/456')
raiseweb.seeother('http://www.baidu.com') 如果带http开头,就会直接跳转网址,而不是在本网站追加。
class input_test1:
defGET(self,name1,name2):
return"Listing info about user: %s , %s "% (name1,name2)
class input_test2:
def GET(self):
i =web.input()
print(i.items())
j=i.items()
return("Listing info about %s:%s,%s:%s" %(str(j[0][0]),str(j[0][1]),str(j[1][0]),str(j[1][1])))
if __name__ == "__main__":
app.run()
测试结果:
输入:http://128.224.162.225:8080/test1
最后网页会打开http://128.224.162.225:8080/input1/123/456
显示: 123 , 456
- web.py – 网页跳转
- web.py – 子网页
- python web.py 网页开发
- web 网页跳转
- web.py – helloworld
- web.py– sessions
- web.py– URL 处理
- web.py – xml模版
- web.py– POST反应
- web.py等框架如何生成静态网页
- python web py入门-2-显示一个demo网页
- web.py (url.py)
- unity3D web 网页跳转的问题
- web跳转网页重新传入Cookie
- web.py
- web.py
- web.py
- web.py
- July 15th 模拟赛C T2 积木游戏 Solution
- 如何在Androdi Studio中导入第三方库
- Java 序列化与反序列化 学习手札
- phonegap plugin.xml 示例
- RecyclerView点击,长按,滑动监听。
- web.py – 网页跳转
- Java super关键字详解
- Android 中图可以用到的图片处理类 BitmapUtils
- Java后台实时输出数据到页面
- C#数组的声明方式
- bzoj1003物流运输
- C++ Lambda表达式(还是比较习惯叫匿名函数)
- 23种设计模式之策略模式(Strategy Pattern)
- C++ 通过ADO.Net实现与MySql数据库连接 入门教程