如何在python中的扭曲资源中呈现html文件?

时间:2017-09-07 06:22:51

标签: python twisted twisted.web

目前我在做这个

from twisted.web.resource import Resource

class MyPostResource(Resource):
    def render_GET(self, request):
        html_file = open("form.html","rb")
        html_file = html_file.readlines()
        html_file = "\n".join(html_file)
        return html_file

在python中使用扭曲资源呈现html文件的正确方法是什么?

0 个答案:

没有答案