标签:print file read ack filename open val row dex
import sys import xlrd import traceback def ReadData(FileName): try: workBook = xlrd.open_workbook(FileName) sheetsList = workBook.sheet_names() sheetNum = len(sheetsList) for i in range(sheetNum): readName = sheetsList[i] #para = [‘sheet%s‘ %i] sheet = workBook.sheet_by_index(i) print(readName+‘:\n‘) for i in range(sheet.nrows): rows = sheet.row_values(i) print(rows) except: traceback.print_exc() if __name__ == ‘__main__‘ : ReadData(‘demo1.xlsx‘)
标签:print file read ack filename open val row dex
原文地址:http://www.cnblogs.com/luoye00/p/6101943.html