135-1821-9792

创新互联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.wtcwzsj.com/article/dhdeshe.html

其他资讯



Copyright © 2009-2022 www.wtcwzsj.com 青羊区广皓图文设计工作室(个体工商户) 版权所有 蜀ICP备19037934号