I am having some trouble finding the best way to write a list to a loaded excel sheet and then saving the result as an xlsx. What I want my code to do is to take the lists that I have created and put them in specific columns of the loaded workbook. I think there is probably an easier way to do this using dataframes, but I do not know how. Ideally, I would like to save the formatting of the loaded workbook. My code does not work as it stands. I am using Spyder from Anaconda.
col_test = [1L, 2L, 3L, 4L, 5L]
My code is this
import xlrt
from xlrd import open_workbook
rb = open_workbook("Excel FDT Master_01_update.xlsx")
s = rb.sheet_by_name('INPUT')
r = 5
for test in col_test:
s.cell(row = r, column = 1).value = test
r += 1
rb.save('didthiswork.xlsx')