flask中for循环
生活随笔
收集整理的這篇文章主要介紹了
flask中for循环
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
(一)針對字典
html代碼:
py代碼:
def fro():user = {'user': 'xxx',`'age': 18}return render_template('fro.html', user=user)(二)針對數組
html代碼:
py代碼:
def fro():user=['1','2','3']return render_template('fro.html', user=user)(三)傳入數組里面含有字典的參數
html代碼:
py代碼:
def fro():web=[{'name':'西游記','author':'吳承恩','price':18},{'name': '西游記','author': '吳承恩','price': 18}]return render_template('fro.html', user=web)總結
以上是生活随笔為你收集整理的flask中for循环的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: delphi char数组、string
- 下一篇: 安卓系统命令 ftp服务器,安卓手机 f