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

Recommended Answers

All 5 Replies

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

Could we get some code. lol :)

>>> 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!

Apparently, it comes from a function in a file named formatting.py in xlrd source, wihch tests wether a string is a date formatting string. I think you should ignore the warning.

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

@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)

:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.