On Mar 29, 9:10 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > aiwarrior <[EMAIL PROTECTED]> wrote: > > def get_value( self, column ): > > self.cursor.execute( "SELECT %s FROM database" % column ) > > for n in self.cursor: > > print n > > I suspect you wanted "self.cursor.fetchall()" there, but since you don't > call it, it doesn't matter yet.
sqlite3's cursor objects support the iteration protocol, so the for- loop does work without calling fetchall(). -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list