Paul Rubin <[email protected]> wrote: > Chris Green <[email protected]> writes: > > self.conn = sqlite3.connect(dbname) > > self.conn.row_factory = sqlite3.Row > > self.cursor = self.conn.cursor() > > self.table = table > > ... > > ... > > sql = "SELECT * FROM " + self.table + " WHERE firstName||lastName = > > ?" > > self.cursor.execute(sql, (name,)) > > row = self.cursor.fetchone() > > untested: > > with sqlite3.connect(dbname) as conn: > sql = "SELECT * FROM " + self.table + " WHERE firstName||lastName = ?" > cursor = conn.execute(sql, (name,)) > row = cursor.fetchone()
Ay? I've maybe not explained well. I want to iterate through row *after* the above code such that I can see the column names as 'keys' and the corresponding values. -- Chris Green ยท -- https://mail.python.org/mailman/listinfo/python-list
