A good first principle of software development is to try to do as little as possible at a time.
So! Part 1 of the task manager is going to be very, very simple, because the goal right now is for you to have somewhere to write Python code and execute it.
I am not the best person to explain how to do this! Here are some resources:
- The Python Foundation's Beginner's Guide is excellent.
- If you want to start by just typing in code and seeing it work, Replit is a great tool. Eventually we'll be organizing bigger units of code, connecting to external services, and so on; be forewarned that might eventually be harder in an environment like Replit.
- If you have access to a standard terminal (either on a Mac or Linux machine, or on Windows via WSL), you can do something like:
nano main.py # type in the code below and save it python3 main.py
Note that any error message you see while you install Python, try to find files in the terminal, and so on is likely to have a zillion answers discoverable by means of search engines. Googling error messages is an important programming skill.
For now this is completely agnostic about how you're editing a file and running it. We'll store the code for our task manager in a file called
Here are some things to know about this code:
tasksis a variable; specifically, it's a list. What we've done is to create a list of four elements, each of which is a string, and assign it to a variable called "tasks."
for task in taskssays, roughly: "Go through each of the elements of
tasks(there are four of them) and assign each of them in turn to the variable named
task; each time you do that, also execute the indented code below." If this is unfamiliar to you, the thing to read about is iterators and for-loops.
And here are some things to know about studying this code:
- If it doesn't make sense immediately, that's OK. I went through that quickly because there are so many beginning Python resources elsewhere. (Aren't you glad you're reading this and not a book?)
- If this is all very familiar to you, OK! We'll hit advanced topics quickly. (But not "advanced" in the sense that the uninitiated won't be able to understand them.)
When you run the code, you should see: