i'm reading a an excel file with xlrd. When i'm running the code a warning pops up:
'WARNING *** format u'"*"' produces constant result '

I think that u'"*"' stands for unicode, is that correct?

But what does 'produces constant result' mean and what implications can it have?

Thanks

I think that '*' is wath is causing the warning.

Could we get some code. lol :)

Edited 6 Years Ago by Beat_Slayer: n/a

>>> import xlrd
>>> wb = xlrd.open_workbook('input_rc.xls')
WARNING *** format u'"*"' produces constant result
>>> sh1 = wb.sheet_by_index(1)
>>> ordervol = []
>>> machine = []
>>> for rownum in range(sh1.nrows):
cell = sh1.cell_value(rownum, 7)
if cell == 'Sector Verf':
ordervol.append(float(sh1.cell_value(rownum, 11)))
machine.append(str(sh1.cell_value(rownum, 14)))
>>> ordervol[34:40]
[1.5, 6.0, 7.0, 3.0, 8.0, 13.5]
>>> machine[34:40]


This is the code I use and an example of the data in the columns that I want to obtain. I must note that the excel file is big; 60000 rows!

@gribouillis thank you for the answer, but how did you figure it out?

Edited 6 Years Ago by daanh: n/a

@gribouillis thank you for the answer, but how did you figure it out?

I wrote excel warning format produces constant result in google's search form and in the 2nd page of google results, there was this link http://nullege.com/codes/show/src@xlrd-0.7.1@xlrd@formatting.py/33/struct.unpack which points to a version of xlrd's source code, which contains the line

fprintf(book.logfile,
	            "WARNING *** format %r produces constant result\n",
	            fmt)

:)

Edited 6 Years Ago by Gribouillis: n/a

This article has been dead for over six months. Start a new discussion instead.