用Bottle显示HTML中的Python变量

问题描述 投票:0回答:1

我正在从烧瓶切换到瓶子,我需要在网页上显示SSID。

我的烧瓶脚本是:

Python:

return render_template('home.html', form=form, ssid=ssid)

HTML:

<p>Device name: {{ ssid }}</p>

我找不到在瓶子里怎么做的。

python html bottle
1个回答
1
投票

使用模板功能:

from bottle import template

return template('home.html', ssid=ssid)
© www.soinside.com 2019 - 2024. All rights reserved.