All projects

A To-Do List in the Terminal

Python Task Manager

A small command-line program in Python: a menu lets you view, add and remove tasks. An exercise in functions, loops, lists and error handling.

Status
Completed
Stack
Python
Links
Source code not public
Placeholder artwork

Overview

The Task Manager is a short Python program for the command line. It manages a task list through a simple menu.

Features

  • An interactive menu with four options that repeats until you exit
  • A numbered task list
  • Add tasks and remove them by their number
  • Invalid numbers are caught with try/except
  • A message when the list is empty

Problem

The project is an exercise: basics such as functions, loops, lists and user input were meant to come together in one small, complete program.

Solution

An endless loop shows the menu, reads the choice and runs the matching action until "Exit" is chosen. Showing the list is a function of its own, which is also used before removing a task.

Technical implementation

The tasks are kept in a Python list. enumerate with a start value of 1 numbers them for display, append adds and pop removes. Input is read with input and converted to a number for removing.

Challenges

The list counts from 0, people count from 1, so the number entered is reduced by one before removing. Input that is not a valid number is caught by a try/except instead of crashing the program.

Limitations

Tasks only exist while the program is running and are not saved. An invalid menu choice simply shows the menu again, without a message. The try/except catches every error rather than only the expected ones.

Lessons learned

This section is still to be written.

Screenshots

A command-line program without a graphical interface. There are no screenshots of its output yet.