标签:oct world render set utf-8 控制 pre str jinjia
示例:
from flask import Flask,render_template
app = Flask(__name__)
@app.route(‘/‘)
def hello_world():
return render_template("index2.html")
if __name__ == ‘__main__‘:
app.run(port=5006)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<table border="1px">
{# 生成九行,x控制行 #}
{% for x in range(1,10) %}
<tr>
{# y控制列 #}
{% for y in range(1,1+x) %}
<td>{{ y }} * {{ x }} = {{ x*y }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
</body>
</html>
标签:oct world render set utf-8 控制 pre str jinjia
原文地址:https://www.cnblogs.com/yingxiongguixing/p/11979994.html