【问题标题】:Show Python variable in HTML with Bottle使用 Bottle 在 HTML 中显示 Python 变量
【发布时间】:2019-11-29 00:04:25
【问题描述】:

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

我的烧瓶脚本是:

Python:

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

HTML:

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

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

【问题讨论】:

    标签: python html bottle


    【解决方案1】:

    使用模板函数:

    from bottle import template
    
    return template('home.html', ssid=ssid)
    

    【讨论】:

      猜你喜欢
      • 2021-07-31
      • 2020-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多