我正在使用 GAE 和 Python,我知道 python,但我不知道 HTML,这似乎是我现在需要的。我想在一个文本文件中写入一些内容,然后将其返回以供下载。我正在使用其他人的示例,但我所拥有的只是:
class MainPage(webapp.RequestHandler):
#http://bukhantsov.org/2011/12/python-google-app-engine-calculator/
def get(self):
self.response.out.write("""<html>
<body>
<form action='/' method='get' autocomplete='off'>
<input type='file' name='file'/><br/>
</form>
</body>
</html>""")
我想我需要在文件行中放入一些东西,以便我可以访问用户提供的内容,但我不知道从 python 代码中访问什么或如何访问它。那么我应该在这里做什么?