I listed the follwoing question:
http://stackoverflow.com/questions/11005335/python-sum-excel-file
I got great help on it, and now I am trying to convert another list in the same format and I am getting the following error using same code.
Traceback (most recent call last):
File "C:/Python27/test2", line 37, in <module>
checkList(name, symbol, amount)
File "C:/Python27/test2", line 22, in checkList
newObject = Object(name, symbol, int(amount)) #Create a new object with new name, produce, and amount
ValueError: invalid literal for int() with base 10: ''
I also was wondering if it is possible to convert the two excel files and then compare the two against each other to see differences?
You are seeing this error because at the line
newObject = Object(name, symbol, int(amount)), the variableamountis an empty string.There are two possibilities here, either that represents invalid data and you should not create a new
Objectinstance to add to your list, or it is okay foramountto be''and you just want to give it a default value (probably0). Here is one way to do this: