Building a Fully Functional Art Gallery Database with Tkinter and SQLite in Python

In this post, I share my experience of completing the 150th and final exercise of "Python by Example" by Nichola Lacey. The exercise involved creating a fully functional database for a hypothetical art gallery that enables users to search based on artist, medium, price, and add/remove art pieces or artist contact information. I used Tkinter for the GUI, SQLite for the database, and wrote 297 lines of Python 3 code. Despite the challenges, the end result is impressive, and the code is available for anyone to use on any Python IDE.


I've just completed the 150th and final exercise of Nichola Lacey's fantastic book "Python by Example". In this exercise, I was tasked with creating a fully functional database for a hypothetical art gallery, which allows users to search based on four different criteria - artist, medium, price (greater than or less than), and also add or remove art pieces or artist contact information.


To build this application, I used Tkinter for the graphical interface, SQLite for the database, and wrote 297 lines of Python 3 code. This was the first project that I've worked on by request, even if it was just an exercise in a book.


This was a challenging exercise for a new programmer, especially figuring out how to make a search button call four different functions instead of just one. Then, I had to tackle the graphical interface, where the search and other buttons would be placed etc.

The end result isn't that bad for just 2 days' worth of work. Despite the simple graphic environment, what matters is that a fully functional database was created that can handle millions of records with complete search and add/remove functionality for all elements.


The code for the entire program is available here as exercise "150" and can run on any Python IDE, allowing users to modify it according to their needs.