Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6608c6c

Browse files
Update todolist.py
1 parent 74728fc commit 6608c6c

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

‎TODO (CLI-VER)/todolist.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@
77
p+=1
88
no_of_items=p-2
99
except:
10-
f=open("todolist.txt",'w')
10+
f=open("./TODO (CLI-VER)/todolist.txt",'w')
1111
f.write("_________TODO LIST__________\n")
1212
f.write(" TIME WORK")
1313
finally:
1414
f.close()
1515
#Todo list
16-
1716
print("Press 1: Add Item \nPress 2: Delete Item \nPress 3: Update item \nPress 4: Display Items\nPress 5: Exit")
1817
n=int(input())
19-
20-
2118
while n==1 or n==2 or n==3 or n==4:
2219
if n==1:
2320
todo=[]
@@ -26,7 +23,7 @@
2623
print("Enter your Work")
2724
work=input()
2825
no_of_items+=1
29-
with open('todolist.txt','a') as f:
26+
with open('./TODO (CLI-VER)/todolist.txt','a') as f:
3027
f.write("\n"+str(no_of_items)+" "+time+" "+work)
3128
elif n==2:
3229
if(no_of_items<=0):
@@ -35,7 +32,7 @@
3532
print("____________________________________________________________")
3633
print("Your Current List: ")
3734
todo=[]
38-
with open('todolist.txt') as f:
35+
with open('./TODO (CLI-VER)/todolist.txt') as f:
3936
for i in f.readlines():
4037
print(i)
4138
todo.append(i)
@@ -49,12 +46,11 @@
4946
else:
5047

5148
todo.pop(pos+1)
52-
5349
no_of_items-=1
5450
if(no_of_items<=0):
5551
print("Congratulations your todo list is empty!")
5652

57-
with open('todolist.txt','w') as f:
53+
with open('./TODO (CLI-VER)/todolist.txt','w') as f:
5854
for i in range(len(todo)):
5955
if i>=(pos+1):
6056
f.write(str(pos)+todo[i][1:])
@@ -66,7 +62,7 @@
6662
print("____________________________________________________________")
6763
print("Your Current List: ")
6864
todo=[]
69-
with open('todolist.txt') as f:
65+
with open('./TODO (CLI-VER)/todolist.txt') as f:
7066
for i in f.readlines():
7167
print(i)
7268
todo.append(i)
@@ -86,7 +82,7 @@
8682
time=input()
8783
p=todo[pos+1].index(":")
8884
y=0
89-
with open('todolist.txt','w') as f:
85+
with open('./TODO (CLI-VER)/todolist.txt','w') as f:
9086
for i in range(len(todo)):
9187
if i==pos+1:
9288
f.write(str(pos)+" "+time+""+''.join(todo[pos+1][p+3:]))
@@ -97,7 +93,7 @@
9793
work=input()
9894
p=todo[pos+1].index(":")
9995
y=0
100-
with open('todolist.txt','w') as f:
96+
with open('./TODO (CLI-VER)/todolist.txt','w') as f:
10197
for i in range(len(todo)):
10298
if i==pos+1:
10399
f.write(str(pos)+" "+''.join(todo[pos+1][p-2:p+3])+" "+work)
@@ -107,7 +103,7 @@
107103
print("Your Current List: ")
108104
todo=[]
109105
print("____________________________________________________________")
110-
with open('todolist.txt') as f:
106+
with open('./TODO (CLI-VER)/todolist.txt') as f:
111107
for i in f.readlines():
112108
print(i)
113109
todo.append(i)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /