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

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -