flask中for循环
生活随笔
收集整理的這篇文章主要介紹了
flask中for循环
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
(一)針對(duì)字典
html代碼:
py代碼:
def fro():user = {'user': 'xxx',`'age': 18}return render_template('fro.html', user=user)(二)針對(duì)數(shù)組
html代碼:
py代碼:
def fro():user=['1','2','3']return render_template('fro.html', user=user)(三)傳入數(shù)組里面含有字典的參數(shù)
html代碼:
py代碼:
def fro():web=[{'name':'西游記','author':'吳承恩','price':18},{'name': '西游記','author': '吳承恩','price': 18}]return render_template('fro.html', user=web)總結(jié)
以上是生活随笔為你收集整理的flask中for循环的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: delphi char数组、string
- 下一篇: 无线局域网的部署