自用,一些工具代码。
pd读取excel
1 | data = pd.DataFrame(pd.read_excel(excel_path)) |
pd输出excel
1 | def output_excel(outputdata, result_path): |
读取json
1 | files = os.listdir(data_dir) |
输出json
1 | def output_json(outputdata, result_path): |
读写excel
1 | import xlrd |
字典
1 | User = dict() |
读写word
1 | from win32com import client as wc |
re
1 | text = re.findall(r'"type":"([^"]+)",', str(longtext)) |