我对 GAE 中的模板渲染有疑问。我想导入一个文本文件并将其写入一个 html 文件。在这个文本文件中,我使用了 html 符号来标记新行新段落。它与 webapp 配合得很好。但是,相同的表达式不适用于 webapp2。所以请给我一些建议。
谢谢!
import webapp2
text_file2 = open('text1.txt','r')
x = text_file2.read()
html = html + template.render(templatepath + 'A.html', {'model_attributes':'Overview','text_paragraph':x})