# Create a program blankRowInserter.py that takes two integers and a filename
# string as command line arguments. Let’s call the first integer N and the second
# integer M. Starting at row N, the program should insert M blank rows into the
# spreadsheet.

import sys
import openpyxl

# Get arguments from commandline
N = int(''.join(sys.argv[1]))
M = int(''.join(sys.argv[2]))
file = ''.join(sys.argv[3])

# Open workbooks
readwb = openpyxl.load_workbook(file)
readsheet = readwb.active

writewb = openpyxl.Workbook()
writesheet = writewb.active

# Read readwb and transpose into writewb
for rowNum in range(1, readsheet.max_row + 1):
    for colNum in range(1, readsheet.max_column + 1):
            if rowNum < N:
                writesheet.cell(row=rowNum, column=colNum).value = readsheet.cell(row=rowNum, column=colNum).value
            else:
                # Insert blank lines
                writesheet.cell(row=(rowNum + M), column=colNum).value = readsheet.cell(row=rowNum, column=colNum).value

# Save workbook
writewb.save("updated" + file)

@@ -1,10 +1,31 @@
-# 
+%22%22%22Blank row inserter%0A%0A
 Create a
@@ -92,18 +92,16 @@
 ilename%0A
-# 
 string a
@@ -172,18 +172,16 @@
  second%0A
-# 
 integer 
@@ -250,18 +250,16 @@
 nto the%0A
-# 
 spreadsh
@@ -264,16 +264,38 @@
 sheet.%0A%0A
+%22%22%22%0A%0A%0Adef main():%0A    
 import s
@@ -297,16 +297,20 @@
 ort sys%0A
+    
 import o
@@ -318,16 +318,20 @@
 enpyxl%0A%0A
+    
 # Get ar
@@ -355,16 +355,20 @@
 andline%0A
+    
 N = int(
@@ -389,16 +389,20 @@
 gv%5B1%5D))%0A
+    
 M = int(
@@ -423,16 +423,20 @@
 gv%5B2%5D))%0A
+    
 file = '
@@ -456,16 +456,20 @@
 gv%5B3%5D)%0A%0A
+    
 # Open w
@@ -477,16 +477,20 @@
 rkbooks%0A
+    
 readwb =
@@ -519,16 +519,20 @@
 k(file)%0A
+    
 readshee
@@ -550,16 +550,20 @@
 active%0A%0A
+    
 writewb 
@@ -584,16 +584,20 @@
 kbook()%0A
+    
 writeshe
@@ -617,16 +617,20 @@
 active%0A%0A
+    
 # Read r
@@ -662,16 +662,20 @@
 writewb%0A
+    
 for rowN
@@ -709,24 +709,28 @@
 x_row + 1):%0A
+    
     for colN
@@ -783,16 +783,20 @@
         
+    
 if rowNu
@@ -810,32 +810,36 @@
                 
+ 
+   
 writesheet.cell(
@@ -937,14 +937,22 @@
     
+    
 else:%0A
+    
     
@@ -992,32 +992,36 @@
                 
+    
 writesheet.cell(
@@ -1110,16 +1110,20 @@
 .value%0A%0A
+    
 # Save w
@@ -1130,16 +1130,20 @@
 orkbook%0A
+    
 writewb.
@@ -1161,12 +1161,52 @@
 ed%22 + file)%0A
+%0A%0Aif __name__ == '__main__':%0A    main()%0A

Update P2_blankRowInserter.py added docstring and wrapped in main() function