Forum Discussion

UnderTest's avatar
UnderTest
Occasional Contributor
8 years ago
Solved

Getting values from the excel file using Python

Hi,   I have an excel file with parameters under two columns. Some cells contains no parameter (empty cells). If value under Column1 is empty, I need the value under Column2.   I use:     te...
  • baxatob's avatar
    8 years ago

    Empty cell returns the None type value, however you are waiting for the empty string.

     

    Try None instead of "" or do it more tricky:

     

    while not myFile.IsEOF():
        value = myFile.Value["Column1"]
        value = value if value is not None else myFile.Value["Column2"]
    ...