Hi,
38938.0
<type 'unicode'>
Traceback (most recent call last):
File "D:\Python23\Te sting area\Python and Excel\xlrdRead. py", line
30, in ?
temp=xlrd.xldat e_as_tuple(sh.c ell_value(rowx= r,colx=c),0)
File "D:\PYTHON23\Li b\site-packages\xlrd\x ldate.py", line 61, in
xldate_as_tuple
xldays = int(xldate)
ValueError: invalid literal for int(): Date
because xlrd.xldate_as_ tuple() function expects first argument to be an
integer. How do I convert an unicode character to integer, so that I
could get the date using xlrd.xldate_as_ tuple() function.
Thank you,
kath.
>>import xlrd
>>book = xlrd.open_workb ook("testbook1. xls")
>>sh = book.sheet_by_i ndex(0)
>>sh.cell_value (rowx=1,colx=0)
>>book = xlrd.open_workb ook("testbook1. xls")
>>sh = book.sheet_by_i ndex(0)
>>sh.cell_value (rowx=1,colx=0)
>>type(sh.cell_ value(rowx=1,co lx=0))
>>xlrd.xldate_a s_tuple( sh.cell_value( rowx = 1,colx= 0 ), 0 )
File "D:\Python23\Te sting area\Python and Excel\xlrdRead. py", line
30, in ?
temp=xlrd.xldat e_as_tuple(sh.c ell_value(rowx= r,colx=c),0)
File "D:\PYTHON23\Li b\site-packages\xlrd\x ldate.py", line 61, in
xldate_as_tuple
xldays = int(xldate)
ValueError: invalid literal for int(): Date
because xlrd.xldate_as_ tuple() function expects first argument to be an
integer. How do I convert an unicode character to integer, so that I
could get the date using xlrd.xldate_as_ tuple() function.
Thank you,
kath.
Comment