Evaluating technology options
Before we start coding, let's take a moment to evaluate the technology choices available to implement this design.
Naturally, we're going to build this form using Python and Tkinter, because that's what this book is about. However, in a real-world situation it's worth asking whether Tkinter is really a good choice of technology for the application. Many criteria come into play when making decisions about languages, libraries, and other technologies used in implementing an application, including performance, feature availability, cost and license, platform support, and developer knowledge and confidence.
Let's evaluate the situation with our ABQ application according to these criteria:
- Performance: This will not be a high-performance application. There are no computationally demanding tasks, and high speed is not critical. Python and Tkinter will work perfectly fine in terms of performance.
- Feature availability: Your application needs to be able to display basic form fields, validate the data entered, and write it to CSV. Tkinter can handle these front-end requirements, and Python can handle the CSV file easily. You are a little concerned about Tkinter's lack of a dedicated date entry field, but this may be something we can work around.
- Cost and license: This project isn't going to be distributed or sold, so licenses are not a big concern. There is no budget for the project, though, so whatever you use will need to be free from any financial cost. Both Python and Tkinter are free and liberally licensed, so in any case this is not a concern.
- Platform support: You will be developing the application on a Windows PC, but it will need to run on Debian Linux, so the choice of GUI should be cross-platform. The computer it will run on is old and slow, so your program needs to be frugal with resources. Python and Tkinter check both boxes here.
- Developer knowledge and confidence: Your expertise is in Python, but you have little experience in creating GUIs. For the fastest time to delivery, you need an option that works well with Python and isn't complicated to learn. You also want something established and stable, as you won't have time to keep up with new developments in the toolkit. Tkinter is a good fit here.
Don't take your own skills, knowledge, and comfort level with the technology out of the equation here! While it's good to make objective choices and recognize your personal biases toward things you already know, it's equally important to recognize that your ability to confidently deliver and maintain a product is a critical factor in your evaluation.
Given the options available for Python, Tkinter is a good choice for this application. It's easy to learn, lightweight, free, readily available on both your development and target platforms, and provides the basic functionality necessary for our data entry form. Having settled this question, it's time to take a deeper look into Tkinter to find what we'll need to build this application.
Python has other options for GUI development, including PyQt, Kivy, and wxPython. These have different strengths and weaknesses compared to Tkinter, but if you find Tkinter doesn't fit well for a project, one of these might be a better option.