py 文件设置编码:

# -*- coding: utf-8 -*-
#coding=utf-8

两种方式任选一种即可

 

输出到浏览器设置编码:

import io
import sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')

 

相关文章:

  • 2021-04-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-12-05
  • 2021-11-17
  • 2021-12-15
猜你喜欢
  • 2021-09-08
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案