1.读库到Excel:
1 # coding=utf-8 2 import pandas as pd 3 import pymysql 4 sql_select =" SELECT * from app_errortest " 5 con = pymysql.connect(host="xxxx", user="xxx", passwd="xxxx", db="xxxx", charset=‘utf8‘,port=5366) 6 df1 = pd.read_excel(r‘D:\1.xls‘,header=None,sep=‘,‘) 7 con.close()
2.写入Excel: