參考書籍:python 操作excel 深智數位 洪錦魁 著 https://www.books.com.tw/products/0010929648
# ch5_1.py import openpyxl fn = "data5_1.xlsx" wb = openpyxl.load_workbook(fn) ws = wb.active ws.insert_rows(4,1) ws.insert_rows(6,1) ws.insert_rows(8) # 省略amount參數 ws.insert_rows(10) # 省略amount參數 wb.save("out5_1.xlsx")