Re: Weird bug with an integer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Genellina

    Re: Weird bug with an integer

    En Thu, 08 May 2008 22:47:59 -0300, David Anderson <zerty.david@gm ail.com>
    escribió:
    Ps:
    When I go to shell and type:rowN = int(0)
    Why int(0)? Why not just 0???
    >Look this slice of code:
    >>
    >rowN = int(0)
    > for row in rows:
    > success = self.resultGrid .AppendRows();
    > colN = int(0)
    > for col in row:
    > self.resultGrid .SetReadOnly(se lf.resultGrid.G etNumberRows()
    >- 1,colN,isReadOn ly = True)
    > print rowN
    > self.resultGrid .SetCellValue(i nt(rowN),int(co lN),col)
    >>
    >I am getting this output:
    >0
    >0
    >0
    >0
    >0
    >0
    >0
    >(1,)
    >Traceback (most recent call last):
    > in populateGrid
    > self.resultGrid .SetCellValue(i nt(rowN),int(co lN),col)
    >TypeError: int() argument must be a string or a number, not 'tuple'
    Your piece of code doesn't show when and how rowN is changed, it's set as
    0 at the start. Try to see what happens with rowN elsewhere...

    --
    Gabriel Genellina

Working...