I'm experiencing weird behavior when appending values to a python list. I am using openpyxl to read values of multiple excel files, do some math and write them to a new excel file. However when looping through the rows in a header column and appending the values to a list, the final result of the list is the value of the cell plus an 'L'. For example, here is the relevant pieces of my code:
xl_file = 'path/to/excel/file.xlsx'
wb = openpyxl.load_workbook(xl_file, data_only=True)
sheet = wb.get_sheet_by_name("sheetname")
hdr_col = [] # empty list to store contents of column header
for r in range(3, 13): # we want rows 3-12. rows 1 and 2 of column hdr are empty
val = sheet.cell(row=r, column = 1).value
print val # prints the actual value (1, 2, 3,..., 10)
hdr_col.append(val)
print hdr_col # prints values with L, i.e.:
[1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L]
Can someone explain to me what's going on? At first I thought it was the openpyxl module but the L only gets added after appending the value to a list so I'm now thinking it's actually Python.