admin管理员组文章数量:1316514
I'm new to html and webpages I have a simple tester html document with two variables at different locations:
testpanel = """<!DOCTYPE html>
<html>
<head> <title>tester Pico W</title> </head>
<body> <h1>tester Pico W</h1>
<p>%s<p>
<p>"hello from tester"<p>
<p>%s</p>
</body>
</html>``
"""
I want to update both %s values before I send the html doc, using the code below
response = testpanel % sentence1 % sentence2
cl.send('HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n')
cl.send(response)
I can't find the correct syntax for updating the two variables. With the above I get " TypeError: format string needs more arguments" Help please.
Ive tried several combinations of sequences in the upadate and send code.
本文标签:
版权声明:本文标题:micropython - How can I place and update 2 variables at different locations in a single html doc - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741983756a2408553.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论