我一直在关注the tutorial on the web.py website,我试图让html页面正常工作,但我一直遇到这个错误:
<type 'exceptions.SyntaxError'> at /
invalid syntax Template traceback:
File 'templates\\index.html', line 14 </body> (index.html, line 14)
我不知道我做错了什么(因为我基本上只是复制/粘贴教程)。在
这里的内容索引.html:
^{pr2}$以下是代码.py:
import web
render = web.template.render('templates/')
urls = (
'/', 'index'
)
class index:
def GET(self):
name = 'Bob'
return render.index(name)
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
为什么它说</body>
处有语法错误?结构与web.py?在
不要在模板中使用html、head和body标记。 所以你的代码应该是这样的:
相关问题 更多 >
编程相关推荐