Simple Task Manager Python Project Day 1

The beginning

Today was the first day that I have started working on my first python project to test out what I have learnt. I was nervous about it but the only way that I am going to learn is by throwing myself into the deep end. The project I would like to work on is a simple task application, it’s very basic as I only want this application to create tasks which have a task name and a due date. I want the tasks to be listed and I want them to be easily removed. In Colt Steel’s “The Modern Python 3 Bootcamp” he never really went over or explained about creating a GUI in python 3, so this will be my first time using and learning Tkinter. Another thing I will be learning for the first time is GitHub, I have heard it is very valuable to learn early as it is something I will have to learn to use in the professional world. This is a really simple application, once I get the basic functionality down, I would love to add some extra features to it.

Learning GitHub

The first thing I did before even starting to code was to go on Youtube and learn how to use GitHub. It took about 20 minutes to make an account, download GitHub desktop and learn the basics of how it worked. I am sure that there is hours worth of stuff to learn about Github, but for now I had it up and running and had created the SimpleTaskManager repository.

screen shot of Simple Task Manager repository
SimpleTaskManager repository

Tkinter

At the start of building this application I created a basic Task class however, as time went on I have since removed it. This is due to the fact that I could just use a list of dictionaries to manage each task and I felt that the application was not going to be big enough that I should use a class.

Screen Shot of Simple Task Manager's Task class
Task Class

It was time to learn how to use Tkinter, a quick google search led me to a number of tutorials where I learnt about windows, frames and the different geometry managers that Tkinter could use. I tried to focus on learning about .pack() and .grid() and how I can add widgets in different positions using those geometry managers. Speaking about widgets I learnt about labels, entrys and buttons. After a while I tried making a basic layout to see how things fitted together. I had a create task button and an entry widget, which would allow the user to enter a task and on clicking the button insert it into some sort of list. But before that could happen I needed to learn out bindings. Bindings give a GUI functionality by waiting for an event to occur such as a mouse click or keyboard press. Once one of these events happens a function is then executed. As a test run I created a binding on the “Create Task” button that when clicked would execute a function called “create_task” which will take the string inputted in the task entry and then produce a label of that string above.

The Result

Simple Task Manager day 1 code
Simple Task Manager day 1 code
First versions of Simple Task Manager
First version of Simple Task Manager

The application was working, I could insert data and then display it. However I quickly ran into a problem which was that when I inserted a task it would keep pushing down the button and entry. I knew that I would need some sort of box to contain the data and at the time I did not know what. That was until I discovered a TTK widget known as tree view.