{"id":142,"date":"2025-10-26T17:26:01","date_gmt":"2025-10-26T17:26:01","guid":{"rendered":"https:\/\/codetypingpro.com\/?p=142"},"modified":"2025-10-26T17:26:01","modified_gmt":"2025-10-26T17:26:01","slug":"13-real-world-python-projects-to-do-list-app","status":"publish","type":"post","link":"https:\/\/codetypingpro.com\/?p=142","title":{"rendered":"13 &#8211; Real-World Python Projects &#8211; To-Do List App"},"content":{"rendered":"\n<h6 class=\"wp-block-heading\">\ud83c\udfaf <strong>Project Objective<\/strong><\/h6>\n\n\n\n<p>To build a <strong>To-Do List Application<\/strong> in Python that allows users to <strong>add, edit, delete, and mark tasks as completed<\/strong> with a simple and intuitive <strong>GUI<\/strong>.<\/p>\n\n\n\n<p><strong>Skills Demonstrated:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Tkinter GUI development<\/li>\n\n\n\n<li>File handling (CSV\/JSON)<\/li>\n\n\n\n<li>Event handling and widget manipulation<\/li>\n\n\n\n<li>Persistent data storage<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Project Description<\/strong><\/h2>\n\n\n\n<p>The To-Do List App lets users:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add daily tasks<\/li>\n\n\n\n<li>Mark tasks as done or pending<\/li>\n\n\n\n<li>Delete completed tasks<\/li>\n\n\n\n<li>Save and load tasks automatically<\/li>\n<\/ul>\n\n\n\n<p><strong>Use Cases:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Personal productivity tool<\/li>\n\n\n\n<li>Student homework tracker<\/li>\n\n\n\n<li>Daily goal planner<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\ud83e\udde9 Example Code \u2013 To-Do List GUI App (Tkinter)<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>import tkinter as tk\nfrom tkinter import messagebox\nimport json\nimport os\n\n# File to store tasks\nTASK_FILE = \"tasks.json\"\n\n# Load existing tasks\nif os.path.exists(TASK_FILE):\n    with open(TASK_FILE, \"r\") as f:\n        tasks = json.load(f)\nelse:\n    tasks = &#91;]\n\n# Save tasks to file\ndef save_tasks():\n    with open(TASK_FILE, \"w\") as f:\n        json.dump(tasks, f)\n\n# Add new task\ndef add_task():\n    task = entry_task.get().strip()\n    if task:\n        tasks.append({\"task\": task, \"done\": False})\n        update_listbox()\n        save_tasks()\n        entry_task.delete(0, tk.END)\n    else:\n        messagebox.showwarning(\"Warning\", \"Please enter a task!\")\n\n# Delete selected task\ndef delete_task():\n    selected = listbox_tasks.curselection()\n    if selected:\n        index = selected&#91;0]\n        tasks.pop(index)\n        update_listbox()\n        save_tasks()\n    else:\n        messagebox.showwarning(\"Warning\", \"Select a task to delete!\")\n\n# Mark task as done\ndef mark_done():\n    selected = listbox_tasks.curselection()\n    if selected:\n        index = selected&#91;0]\n        tasks&#91;index]&#91;\"done\"] = True\n        update_listbox()\n        save_tasks()\n    else:\n        messagebox.showwarning(\"Warning\", \"Select a task to mark as done!\")\n\n# Update listbox display\ndef update_listbox():\n    listbox_tasks.delete(0, tk.END)\n    for i, task in enumerate(tasks):\n        status = \"\u2705\" if task&#91;\"done\"] else \"\u274c\"\n        listbox_tasks.insert(tk.END, f\"{status} {task&#91;'task']}\")\n\n# GUI setup\nroot = tk.Tk()\nroot.title(\"To-Do List App\")\nroot.geometry(\"400x400\")\n\ntk.Label(root, text=\"Enter a new task:\", font=(\"Arial\", 12)).pack(pady=5)\nentry_task = tk.Entry(root, width=35)\nentry_task.pack(pady=5)\n\n# Buttons\nframe_buttons = tk.Frame(root)\nframe_buttons.pack(pady=10)\n\ntk.Button(frame_buttons, text=\"Add Task\", command=add_task).grid(row=0, column=0, padx=5)\ntk.Button(frame_buttons, text=\"Mark Done\", command=mark_done).grid(row=0, column=1, padx=5)\ntk.Button(frame_buttons, text=\"Delete Task\", command=delete_task).grid(row=0, column=2, padx=5)\n\n# Task list display\nlistbox_tasks = tk.Listbox(root, width=50, height=15)\nlistbox_tasks.pack(pady=10)\n\nupdate_listbox()\nroot.mainloop()\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 <strong>Output<\/strong><\/h3>\n\n\n\n<p>A GUI window with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Text entry field to add new tasks<\/li>\n\n\n\n<li>Listbox showing tasks with \u2705 (done) or \u274c (pending)<\/li>\n\n\n\n<li>Buttons to add, delete, and mark tasks<\/li>\n\n\n\n<li>Automatic save and load from <code>tasks.json<\/code><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2705 Key Features<\/strong><\/h2>\n\n\n\n<p>Extensible for more advanced features<\/p>\n\n\n\n<p>Simple, user-friendly GUI<\/p>\n\n\n\n<p>Task management (add, delete, mark done)<\/p>\n\n\n\n<p>Persistent storage (JSON file)<\/p>\n\n\n\n<p>Status tracking with visual indicators<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83c\udfaf Project Objective To build a To-Do List Application in Python that allows users to add, edit, delete, and mark tasks as completed with a simple and intuitive GUI. Skills Demonstrated: Project Description The To-Do List App lets users: Use Cases: \ud83e\udde9 Example Code \u2013 To-Do List GUI App (Tkinter) \u2705 Output A GUI window [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=142"}],"version-history":[{"count":1,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":143,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions\/143"}],"wp:attachment":[{"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codetypingpro.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}