def getXlsString(sh, i, in_columns_j): impValues = {} for item in in_columns_j.keys(): j = in_columns_j[item] - 1 if item in ('закупка', 'продажа', 'цена1'): if getCell(row=i, col=j, isDigit='N', sheet=sh).find('call') >= 0: impValues[item] = '0.1' else: impValues[item] = getCell(row=i, col=j, isDigit='Y', sheet=sh) #print(sh, i, sh.cell( row=i, column=j).value, sh.cell(row=i, column=j).number_format, currencyType(sh, i, j)) elif item == 'валюта_по_формату': impValues[item] = currencyType(row=i, col=j, sheet=sh) else: impValues[item] = getCell(row=i, col=j, isDigit='N', sheet=sh) return impValues
def getXlsString(sh, i, in_columns_j): #print(type(sh)) # <class 'xlrd.sheet.Sheet'> impValues = {} for item in in_columns_j.keys(): j = in_columns_j[item] - 1 if item in ('закупка', 'продажа', 'цена со скидкой', 'цена_'): if getCell(row=i, col=j, isDigit='N', sheet=sh) == '': # .find('Звоните') >=0 : impValues[item] = '0.1' else: impValues[item] = getCell(row=i, col=j, isDigit='Y', sheet=sh) #print(sh, i, sh.cell( row=i, column=j).value, sh.cell(row=i, column=j).number_format, currencyType(sh, i, j)) elif item == 'валюта_по_формату': impValues[item] = currencyType(row=i, col=j, sheet=sh) else: impValues[item] = getCell(row=i, col=j, isDigit='N', sheet=sh) return impValues