Re: xlrd

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gary Herron

    Re: xlrd

    Yeats wrote:
    Hi,
    >
    Years ago i use xlrd to read data from excel and now I need again, but
    i get strange result. The code is:
    >
    from xlrd import *
    >
    Planilha = open_workbook(' C:\\Resultados. xls')
    Resultados = Planilha.sheet_ by_name('Result ados')
    c = (Resultados.cel l_value(2,2))
    print c
    >
    and the result is: 0, but the value in cell is : VERDADEIRO
    >
    What´s the problem
    I've never used xlrd, but based on other packages for accessing spread
    sheets, here's one guess.

    Cells can have numeric values or string values. Your cell apparently
    has a string, but you are asking for a numeric value, so you get a
    zero. Should you be asking for a string value? (That's the way
    OpenOffice/python works if I remember correctly.)

    Or are you accessing a different cell because you've confused 0-based /
    1-based indexing?

    Or are you using old outdated versions of xlrd, Python or Excel?

    Gary Herron


    >
    Thanks and sorry my bad english
    Yeats
    >
    ------------------------------------------------------------------------
    >
    --
    http://mail.python.org/mailman/listinfo/python-list
Working...