I am writing a Python script and stuck on one of the early steps. I am opening an existing sheet and want to add two columns so I have used this:
#import the writer
import xlwt
#import the reader
import xlrd
#open the sussex results spreadsheet
book = xlrd.open_workbook('sussex.xlsx')
#open the first sheet
first_sheet = book.sheet_by_index(0)
#print the values in the second column of the first sheet
print first_sheet.col_values(1)
#in cell 0,0 (first cell of the first row) write "NIF"
sheet1.write(0, 6, "NIF")
#in cell 0,0 (first cell of the first row) write "Points scored"
sheet1.write(0, 6, "Points scored")
On line 12 I get an error:
name 'sheet1' is not defined
How do I define sheet 1 within the sheet that I have already opened?