新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:pythonredirect函數(shù)怎么用?

創(chuàng)新互聯(lián)專注于龍城企業(yè)網(wǎng)站建設,成都響應式網(wǎng)站建設公司,商城網(wǎng)站制作。龍城網(wǎng)站建設公司,為龍城等地區(qū)提供建站服務。全流程按需開發(fā)網(wǎng)站,專業(yè)設計,全程項目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務
本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。
描述:
跳轉指定的url
語法:
redirect();
參數(shù):
path
實例使用:
from flask import redirect
def redirect(path):
header = 'HTTP/1.1 302 JUMP\r\nContent-Type: text/html\r\n'
location = 'Location: {}'.format(path)
response = header + location
return response.encode('utf-8')
《相關推薦:php框架》
上述我們可以獲知信息,我們可以跳轉到新的鏈接里,需要使用from flask import redirect導入,才可以正式進行函數(shù)的使用。
標題名稱:創(chuàng)新互聯(lián)Python教程:pythonredirect函數(shù)怎么用?
網(wǎng)站URL:http://m.5511xx.com/article/cosgedg.html


咨詢
建站咨詢
