In this recipe, we will explore a typical way to create spaghetti code and then we will see a much better way of how to avoid such code.
Avoiding spaghetti code
Getting ready
We will create a new, simple GUI, written in Python using the built-in Python tkinkter library.
How to do it...
Having searched online and read the documentation, we might start by writing the following code to create our GUI:
- Create a new module: GUI_Spaghetti.py.
- Add the following code:
# Spaghetti Code ##################...