-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday45_100c.py
130 lines (123 loc) · 3.98 KB
/
day45_100c.py
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# OpenAI GPT3 Assisted Code
import os, time
lifeOrg = []
def prettyPrint():
print()
for row in lifeOrg:
for item in row:
print(f"{item:^10}", end=" | ")
print()
print()
while True:
os.system("clear")
print("\t\t🌟Life Organizer🌟")
print()
print("\tTODO List Management System")
print("\tVIEW")
print()
time.sleep(0.3)
print("1: Add")
time.sleep(0.3)
print("2: View")
time.sleep(0.3)
print("3: Remove")
time.sleep(0.3)
print("4: Edit")
time.sleep(0.3)
print()
menu = input("> ")
if (menu.strip().lower()[0] == "a" or menu.strip().lower()[0] == "1"):
print()
print("ADD A TASK")
print()
task = input("What is the task? ")
due = input("When is it due? ")
prio = input("What is its priority? (HIGH/MED/LOW) ")
row = [task, due, prio]
lifeOrg.append(row)
elif (menu.strip().lower()[0] == "v" or menu.strip().lower()[0] == "2"):
os.system("clear")
print("\t\t🌟Life Organizer🌟")
print()
print("\tTODO List Management System")
print()
time.sleep(0.3)
print("1: View All")
time.sleep(0.3)
print("2: View Priority")
print()
viewCho = input("> ")
if (viewCho.strip().lower()[0] == "a" or viewCho.strip().lower()[0] == "1"):
os.system("clear")
print("\t\t🌟Life Organizer🌟")
print()
print("\tTODO List Management System")
print()
prettyPrint()
time.sleep(2)
elif (viewCho.strip().lower()[0] == "p" or viewCho.strip().lower()[0] == "2"):
print("Enter the priority level you want to view: ")
print("(HIGH/MEDIUM/LOW)")
priority_level = input("> ").upper()
for row in lifeOrg:
if row[2].upper() == priority_level:
print(row)
# print(f"{item:^10}", end=" | ")
time.sleep(2)
elif (menu.strip().lower()[0] == "r" or menu.strip().lower()[0] == "3"):
os.system("clear")
print("\t\t🌟Life Organizer🌟")
print()
print("\tTODO List Management System")
print("\tWhat task do you wish to Remove? ")
print()
prettyPrint()
print()
task = input("> ")
items_to_remove = []
for row in lifeOrg:
if task in row:
items_to_remove.append(row)
for item in items_to_remove:
lifeOrg.remove(item)
# oh, wow, this one actually worked.
# for row in lifeOrg:
# if task in row:
# lifeOrg.remove(row)
# else:
# print("That task is not in the list of tasks.")
# time.sleep(2)
# break
elif (menu.strip().lower()[0] == "e" or menu.strip().lower()[0] == "4"):
os.system("clear")
print("\t\t🌟Life Organizer🌟")
print()
print("\tTODO List Management System")
print("\tWhat task do you wish to EDIT? ")
print()
prettyPrint()
print()
task = input("> ")
for row in lifeOrg:
if task in row:
print("Which field do you want to edit?")
print("1: Task")
print("2: Due Date")
print("3: Priority")
field = input("> ")
if field == "1":
new_task = input("Enter the new task: ")
row[0] = new_task
elif field == "2":
new_due_date = input("Enter the new due date: ")
row[1] = new_due_date
elif field == "3":
new_priority = input("Enter the new priority: ")
row[2] = new_priority
else:
print("Invalid field choice")
print()
print("Updated task list:")
prettyPrint()
time.sleep(2)
prettyPrint()