How it works…
You can see in the script that the click() event of the push button with the objectName property pushButtonDisplayRows is connected to the DisplayRows() method. This means that, whenever this push button is clicked, the DisplayRows() method will be invoked. In the DisplayRows() method, an SQL SELECT statement is defined that fetches the rows from the table whose name is specified in the Line Edit widget. Also, a connection is established with the database whose name is entered in the Line Edit widget. Thereafter, the SQL SELECT statement is executed. The fetchall() method is executed on the cursor to keep all the rows that are accessed from the database table.
A for loop is executed to access one tuple at a time from the received ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access