excel - Select specific cells for range function in openpyxl package of Python -


i have code:

from openpyxl import workbook wb = workbook() ws = wb.active  in range(10):    ws.append([i]) 

this writes range(10) (0-9 values) a1 a10. how can change these cell other cells? example b1 b10 or a1 j10?

ws.append(seq) treats sequence or iterable passed in whole row. first value first column. if want first value column need pad sequence none.

something following add 4 rows of ten values starting in fifth column.

seq = [none] * 4  + list(range(10)) in range(10):    ws.append(seq) 

for more control use ws.cell()as covered in documentation.


Comments

Popular posts from this blog

php - How can an email be returned from Stripe Checkout? -

SQL php on different pages to Insert (mysqli) -

linked list - Get the index of the Node in a LinkedList which contains the given value in java -