Reading from the database

The database query for reading all records from the database is as follows:

query = 'SELECT * FROM contacts ORDER BY name desc'phone_book_entries = self.execute_db_query(query)

The preceding variable, phone_book_entries, contains a list of all the records from the database.

Get Tkinter GUI Application Development Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.