# csv 只适合单个sheet 表
import csv
with open("./bb.csv","rt",encoding="utf-8-sig") as f:
reader = csv.reader(f)
for i in reader:
print(i)
import json
import xlrd
wb = xlrd.open_workbook("./student.xlsx")
sheet_names = wb.sheet_names()
print(sheet_names)
ws = wb.sheet_by_name("Sheet1")
print(ws.name,ws.nrows,ws.ncols)
row_3 = ws.row_values(0)
print(row_3)
cols_3 = ws.col_values(2)
print(ws.row(3))
print(type(json.loads(ws.cell_value(3,2))))
from xlutils.copy import copy
rd_book = xlrd.open_workbook("./student.xlsx")
wt_book = copy(rd_book)
ws = wt_book.get_sheet(0)
ws.write(4,0,"haha")
print(ws)
wt_book.save("./student1.xlsx")