Webpy:变量未在 html 中正确显示

Webpy: Variables not showing properly in html

我在使用 webpy 时遇到错误,我的字符串是 "No client",但是在浏览器中打开 html 时我只得到 'No',白色的 space剩下的字符串丢失了!我做错了什么?

这是 .html 部分的内容:

<input type="text" placeholder= $:name2 value= $:name2 name="name3" id="nome3" readonly>

我尝试了 $:name2 和 $name2,可能是因为某些字符串格式。

我认为您只需要在值周围加上引号。你的例子应该变成:

<input type="text" placeholder="$:nome2" value="$:nome2" name="nome3" id="nome3" readonly>