Sample code:
From where? openpyxl? Import? *。
File name? =? ' test.xlsx ' .
wb? =? wb? =? Load the workbook (file name).
ws? =? wb.active .
ws.delete_rows(2,2)? # Delete two lines after index 2.
Extended data:
When Python executes. The py file will be compiled into Python bytecodes, and then the Python Virtual Machine will execute these compiled bytecodes.
The basic idea of this mechanism is related to Java and. Net. However, Python virtual machines are different from Java or. NET virtual machine, Python virtual machine is a more advanced virtual machine.
Baidu encyclopedia -Python