-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
58 lines (52 loc) · 1.93 KB
/
main.py
File metadata and controls
58 lines (52 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from connection import add_task, view_tasks, update_task, delete_task
import os
import sys
import time
def main():
print("Starting the application...")
os.system("cls")
print("""
Welcome to TODO List Cli developed in Python!
😀😀😀😀😀😀😀😀😀
This CLI was developed by Gleizits. The source code can be found on his GitHub. Thank you for downloading it.
Loading Tasks...
""")
time.sleep(2)
a = input("Press Enter to continue...")
if a == "":
os.system("cls")
while True:
print("""
TODO List Menu:
1. Add Task
2. View Tasks
3. Update Task
4. Delete Task
5. Exit
""")
choice = int(input("Choose an option (1-5): "))
if choice == 1:
title = input("Enter task title: ")
description = input("Enter task description: ")
status = input("Enter task status (pending/completed): ")
add_task(title, description, status)
elif choice == 2:
view_tasks()
elif choice == 3:
task_id = int(input("Enter task ID to update: "))
title = input("Enter new task title: ")
description = input("Enter new task description: ")
status = input("Enter new task status (pending/completed): ")
update_task(task_id, title, description, status)
elif choice == 4:
task_id = int(input("Enter task ID to delete: "))
delete_task(task_id)
elif choice == 5:
print("Exiting the application..... \nGoodbye!😀")
break
else:
print("Invalid choice. Please try again.")
input("Press Enter to continue...")
os.system("cls")
if __name__ == "__main__":
main()