# 开发人员 : llm
#时间ccc:
import xlrd
import xlwt
def read_xls():
info = xlrd.open_workbook('pytest.xls')
print(info)
sheet_names = info.sheet_names()
print(sheet_names)
sheet = info.sheet_by_index(0)
print(sheet.row_values(1))
print(sheet.row_values(0))
print(sheet.nrows)
print(sheet.ncols)
def write_xls():
newbook = xlwt.Workbook()
newsheet = newbook.add_sheet('第二')
newsheet.write(2, 0, 3)
newsheet.write(2, 1, 1)
newsheet.write(2, 2, xlwt.Formula("A3+B3"))
newbook.save('newbook.xls')
import openpyxl
if __name__ == "__main__":
read_xls()
write_xls()