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

創(chuàng)新互聯(lián)專注于龍城企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè)公司,商城網(wǎng)站制作。龍城網(wǎng)站建設(shè)公司,為龍城等地區(qū)提供建站服務(wù)。全流程按需開發(fā)網(wǎng)站,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)
本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。
描述:
跳轉(zhuǎn)指定的url
語法:
redirect();
參數(shù):
path
實(shí)例使用:
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')
《相關(guān)推薦:php框架》
上述我們可以獲知信息,我們可以跳轉(zhuǎn)到新的鏈接里,需要使用from flask import redirect導(dǎo)入,才可以正式進(jìn)行函數(shù)的使用。
網(wǎng)頁題目:創(chuàng)新互聯(lián)Python教程:pythonredirect函數(shù)怎么用?
鏈接URL:http://www.dlmjj.cn/article/cosgedg.html


咨詢
建站咨詢
