how to convert UNICODE to integer in Python?
nitte.sudhir at gmail.com
Fri Oct 6 13:16:24 CEST 2006
Fredrik Lundh wrote:
> kath wrote:
> > 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.
> the error doesn't say anything about Unicode characters, it says that
> someone's passing the string "Date" to the int() function.
> >>> int("Date")
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ValueError: invalid literal for int(): Date
Thanks for reminding me. I was wrong.
More information about the Python-list