def count_rows ( self , table_name ) : self . table_must_exist ( table_name ) query = "SELECT COUNT (*) FROM `%s`" % table_name . lower ( ) self . own_cursor . execute ( query ) return int ( self . own_cursor . fetchone ( ) [ 0 ] )
how do i count the number of records in a python table
Return the number of entries in a table by counting them .
def count_rows(self, table_name):
        """Return the number of entries in a table by counting them."""
        self.table_must_exist(table_name)
        query = "SELECT COUNT (*) FROM `%s`" % table_name.lower()
        self.own_cursor.execute(query)
        return int(self.own_cursor.fetchone()[0])