读写utf-8文件
fh = open(file_name, ‘r‘, encoding = ‘UTF-8‘)
读写数据库utf-8格式
connect = pymysql.connect(host=‘127.0.0.1‘, user=‘root‘, passwd=‘123456‘, db=‘code_bank‘, charset=‘utf8‘)
时间: 2024-10-14 15:57:54
读写utf-8文件
fh = open(file_name, ‘r‘, encoding = ‘UTF-8‘)
读写数据库utf-8格式
connect = pymysql.connect(host=‘127.0.0.1‘, user=‘root‘, passwd=‘123456‘, db=‘code_bank‘, charset=‘utf8‘)