First, we move the widgets from our Python GUI around between the two tabs we created in the previous recipes in order to organize our Python GUI better to connect to a MySQL database.
We rename several widgets and separate the code that accesses the MySQL data to what used to be named Tab 1, and we will move unrelated widgets to what we called Tab 2 in earlier recipes. We also adjust some internal Python variable names in order to understand our code better.
Our refactored Python GUI now looks like the following screenshot. We have renamed the first tab as MySQL and created two tkinter LabelFrame widgets. We labeled the one on the top Python database and it contains ...