Just as logically breaking our program into separate concerns helps us manage the logical complexity of each component, physically breaking the code into multiple files helps us keep the complexity of each file manageable. It also reinforces more isolation between components; for example, you can't share global variables, and if your models file imports tkinter
, you know you're doing something wrong.
There is no official standard for laying out a Python application directory, but there are some common conventions that will help us keep things tidy and make it easier to package our software later on. Let's set up our directory structure as follows:
- To begin, create a directory called
ABQ_Data_Entry
. This is the root directory of our application, so whenever we refer to the application root, this is it.
- Under the application root, create another directory called
abq_data_entry
. Notice it's in lowercase. This is going to be a Python...