import openpyxl,os
os.chdir('D://')
a = input('输入文件名:')
n = eval(input('第N行开始?'))
m = eval(input('插入M行?'))
wb = openpyxl.load_workbook(a)
sheet = wb.active
i = sheet.max_row
if n >= i:
print('超出行数!最大行数为' + str(i))
while i >= n:
for j in range(1,sheet.max_column+1):
sheet.cell(row=i+m,column=j).value = sheet.cell(row=i,column=j).value
i -= 1
for q in range(n+1,n+m+1):
for j in range(1,sheet.max_column+1):
sheet.cell(row=q,column=j).value = ''
wb.save(a)
print('Done!')