forked from ashu3752/Hacktober2021
-
Notifications
You must be signed in to change notification settings - Fork 1
/
healthmanagement.py
137 lines (106 loc) · 3.22 KB
/
healthmanagement.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
131
132
133
134
135
136
137
# f = open("KrishDiet.txt","w")
# f.write("Hi Krish here is your diet")
# f.close()
# f = open("Krishexercise.txt","w")
# f.write("Hi Krish here is your exercise")
# f.close()
#
# f = open("SamirDiet.txt","w")
# f.write("Hi Samir here is your diet")
# f.close()
# f = open("Samirexercise.txt","w")
# f.write("Hi Samir here is your exercise")
# f.close()
#
# f = open("HarryDiet.txt","w")
# f.write("Hi harry here is your diet")
# f.close()
# f = open("Harryexercise.txt","w")
# f.write("Hi Harry here is your exercise")
# f.close()
def getdate():
import datetime
return datetime.datetime.now()
print("What do you want to add press 1 for exercise or press 2 for diet")
inp=int(input())
if inp==1:
print("what is your name")
inpname=input()
if inpname=="Krish":
print("What do you want to do add or read")
inpdo=input()
if inpdo=="add":
print("Now you can add")
d= open("Krishexercise.txt","a")
d.write(input("\n"))
print("successfully written")
elif inpdo=="read":
e=open("Krishexercise.txt")
print(e.read())
e.close()
if inpname=="Samir":
print("What do you want to do add or read")
inpdo = input()
if inpdo == "add":
print("Now you can add")
f = open("Samirexercise.txt","a")
f.write(input())
print("successfullywritten")
elif inpdo == "read":
g = open("Samirexercise.txt")
print(g.read())
g.close()
if inpname=="Harry":
print("What do you want to do add or read")
inpdo = input()
if inpdo == "add":
print("Now you can add")
h = open("Harryexercise.txt","a")
h.write(input())
print("successfully written")
elif inpdo == "read":
i = open("Harryexercise.txt")
print(i.read())
i.close()
elif inp==2:
print("what is your name")
inpname=input()
if inpname=="Krish":
print("What do you want to do add or read")
inpdo=input()
if inpdo=="add":
print("Now you can add")
j= open("KrishDiet.txt","a")
j.write(input())
print("successfully written")
elif inpdo == "read":
h = open("KrishDiet.txt")
print(h.read())
h.close()
if inpname=="Samir":
print("What do you want to do add or read")
inpdo = input()
if inpdo == "add":
print("Now you can add")
i = open("SamirDiet.txt","a")
i.write(input())
print("successfully written")
elif inpdo == "read":
j = open("SamirDiet.txt.txt")
print(j.read())
j.close()
if inpname=="Harry":
print("What do you want to do add or read")
inpdo = input()
if inpdo == "add":
print("Now you can add")
k = open("HarryDiet.txt","a")
k.write(input())
print("successfully written")
elif inpdo == "read":
l = open("HarryDiet.txt")
print(l.read())
l.close()
else:
print("Error")
print("please try again")