xlsx_file = "test.xlsx"
wb = openpyxl.Workbook(xlsx_file)
ws = wb.active
ws["A1"]="hello world"
ws["A2"]="this is test"
xlsx_file = "test.xlsx"
wb = openpyxl.load_workbook(xlsx_file)
ws = wb.active
ws["A1"]="hello world"
ws["A2"]="this is test"
原文:https://www.cnblogs.com/wanderingfish/p/9347803.html