例子文件如下: 一些复杂的读取操作getCells.py import openpyxl wb = openpyxl.load_workbook('example.xlsx') sheet = wb.get_sheet_by_name('Sheet1') print(sheet.cell(row=1, column=2).value) # from 1 to 8 step is 2 for i in range(1, sheet.max_row + 1, 2): print(i, sheet.c
环境:MySQLdb openpyxl模块 python去zabbix的mysql数据库中取交换机不同时间段的进出口流量,然后写入excel中,每天cron执行,每周四邮件发送.(代码中第一行必须加上,不然crontab执行不了,或者在crontab时指明环境变量) #!/usr/local/bin/python2.7 #_*_coding:utf-8_*_ import MySQLdb import time from datetime import datetime from datetim