On 21 Jan 2007 14:35:19 -0800, Nanjundi <[EMAIL PROTECTED]> wrote: > > > > if __name__ == '__main__': > > gert=Db('localhost','root','******','gert') > > gert.excecute('select * from person') > > for x in range(0,gert.rowcount): > > print gert.fetchone() > > gert.close() > > > > [EMAIL PROTECTED]:~$ python ./Desktop/svn/db/Py/db.py > > Traceback (most recent call last): > > File "./Desktop/svn/db/Py/db.py", line 35, in <module> > > for x in range(0,gert.rowcount): > > TypeError: range() integer end argument expected, got instancemethod. > > [EMAIL PROTECTED]:~$ > > > > Can anybody explain what i must do in order to get integer instead of > > a instance ? > > Gert, > > for x in range(0,gert.rowcount): > gert.rowcount is the method (and not a data attribute). > gert.rowcount() is the method call, which get the return value from > method. > > So try this. > for x in range( 0,gert.rowcount() ): >
Doh! :) thx -- http://mail.python.org/mailman/listinfo/python-list