How it works...

We started with the GUI_TCP_IP.py file from the previous chapter and reorganized the widgets.

We renamed several widgets and separated the code that accesses the MySQL data to what used to be named Tab 1, and we moved the unrelated widgets to what we named Tab 2 in the previous recipes. We also adjusted some internal Python variable names so that we can understand our code better.

Code readability is a coding virtue and not a waste of time.

The refactored module is close to 400 lines of Python code and it would take too many pages to show the entire code here. On Windows, we can use a tool called WinMerge to compare different Python code modules. I am sure there are similar tools for macOS and Linux.

WinMerge is a great tool ...

Get Python GUI Programming Cookbook - Third 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.