I am trying to use the package XLRD to read the value of row 2(row 1 in excel), in particular column A.
I know that the value is "text:u'NULL'" but if I try to write an if function which compares a variable which I have given the same value, it does not recognise them as the same.
(Just to explain my spreadsheet has the value Null in the cell I am referring to but using XLRD it reads this as "text:u'NULL'" which is fine)
I have created a test example of what I am referring to as this is hard to describe. The value for b on line 20 of my code is definitely "text:u'NULL'", so I have no idea why it does not read this as equal to b.
import xlrd
book = xlrd.open_workbook("excelscores.xls")
sheet_name = book.sheet_names()[0]
sheet = book.sheet_by_name(sheet_name)
row_no = 1
row = sheet.row(row_no)
## successful test
a = ['lewis','dylan']
b = a[0]
c = 'lewis'
if c == b:
print "c is equal to b"
else:
print "fail"
## test that fails
a = row
b = a[0]
c = "text:u'NULL'"
if c == b:
print "c is equal to b"
else:
print "fail"enter code here