2020
09-29
09-29
python3 使用openpyxl将mysql数据写入xlsx的操作
编程的生活愈发不容易了,工作越来越难找,说多了都是泪还是给大家贡献些代码比较实际。python3链接数据库需要下载名为pymysql的第三方库python3读写xlsx需要下载名为openpyxl的第三方库在此我只贡献链接数据库和写入xlsx的代码importpymysql.cursorsfromfj.utilimportloggerfromopenpyxlimportWorkbookfromopenpyxl.compatimportrangefromopenpyxl.utilsimportget_column_letter#链接数据库的游标connect=pymy...
继续阅读 >
我就废话不多说了,还是直接看代码吧!importosimportopenpyxlfromdatetimeimportdatefromopenpyxlimportWorkbookfromopenpyxl.chartimport(Series,LineChart,Reference,)defadd_line_chart(title,wss,min_col,min_row,max_col,max_row):c1=LineChart()c1.title=title#图的标题c1.style=12#线条的stylec1.y_axis.title='percent'#y坐标的标题if'IDC'notintitle:c1.x_axis.number_for...