028-86922220
建站资讯

网站建设资讯

为你提供网站建设行业资讯、网站优化知识、主机域名邮箱、网站开发常见问题等。

创新互联Python教程:pythonweb.py乱码怎么解决?

web.py中的中文字符串在网页显示乱码解决方法如下:

#!/usr/bin/env python  
# encoding: utf-8  
import web
urls = (
    '/', 'index'
)
class index:
    def GET(self):
        web.header('Content-Type', 'text/html;charset=UTF-8')
        return "

你好!

" if __name__ == "__main__":     app = web.application(urls, globals())     app.run()

分享题目:创新互联Python教程:pythonweb.py乱码怎么解决?
转载源于:http://www.whjierui.cn/article/dhdeshe.html

其他资讯