Nov-15-2020, 06:49 PM
(Nov-13-2020, 02:35 PM)DeaD_EyE Wrote: [ -> ]The notice to myself was to write CONSTANS in Code in upper case (PEP8). You weren't meant.
That you can't change the content in your Excel-File should be clear.
I guess its data you get from somewhere and you've no influence of the fields/naming.
This is in 99.999% the case. + missing and wrong Data + bugs in cell datatype format
If you work with openpyxl it should do automatic conversions to Python types.
But cells with explicit text format, which have strings like "false", "NONE", "none", "true" etc. are not converted into Boolean. You get this "Keywords" as str. I think this is what you want and need.
Hi i am not chaging the excel, i am reading it and at the same same interpreting the information to write a XML script with several decisions based of combinationes predifined by the costumer.
As some fileds may be "empty" i need to check always before doing any processing if it is None or not.
I am still testing the openpyxl, i am going to try
for row in worksheet2.iter_rows(min_row=Fila_LNBTS_TEMPLATE, min_col=IndexCol_WS2, max_row=Fila_LNBTS_TEMPLATE, max_col=MaxNumCol+1):
for cell in row:
ParameterValue_WS2 = cell.value
Instead:
for IndexCol_WS2 in range(IndexCol_WS2, MaxNumCol+1):
ParameterValue_WS2 = worksheet2.cell(row=FilaTemplateID, column=IndexCol_WS2).value