用python实现读取xml文档内容

import xlrd

filePath = "E:\\python.xlsx"
worksheet = xlrd.open_workbook(filePath)
sheet_names = worksheet.sheet_names()
for sh_name in sheet_names:
    sheet = worksheet.sheet_by_name(sh_name)

    mRows = sheet.nrows
    mCols = sheet.ncols
    print("-------------------------------" + sh_name + "-------------------------------")
    for i in range(mRows):
        for j in range(mCols):
            print("坐标(", i, ",", j, ")对应值是:", sheet.row_values(i)[j])

你可能感兴趣的:(学习文档)