-
Notifications
You must be signed in to change notification settings - Fork 0
/
Health management system.py
84 lines (71 loc) · 2.29 KB
/
Health management system.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
import datetime
def gettime():
return datetime.datetime.now()
def log(k):
c=int(input("1.exercise and 2.food:"))
if c==1:
if k==1:
value=str(input("enter the value:"))
with open("meet_logex.txt","a") as f:
f.write(str(gettime())+":"+value+"\n")
print("written successful")
elif k==2:
value = str(input("enter the value:"))
with open("zenith_logex.txt","a") as f:
f.write(str(gettime())+ ":"+ value+"\n")
print("written successful")
elif k== 3:
value=str(input("enter the value"))
with open("prince_logex.txt","a") as f:
f.write(str(gettime())+":"+value+"\n")
print("written successful")
elif c==2:
if k==1:
value=str(input("enter the value:"))
with open("meet_logfood.txt","a") as f:
f.write(str(gettime())+":"+value+"\n")
print("written successful")
elif k==2:
value = str(input("enter the value:"))
with open("zenith_logfood.txt","a") as f:
f.write(str(gettime())+ ":"+ value+"\n")
print("written successful")
elif k== 3:
value=str(input("enter the value"))
with open("prince_logfood.txt","a") as f:
f.write(str(gettime())+":"+value+"\n")
print("written successful")
def retrive(k):
c = int(input("1.exercise and 2.food:"))
if c==1:
if k == 1:
f = open("meet_logex.txt")
b = f.read()
print(b)
elif k == 2:
f = open("zenith_logex.txt")
b = f.read()
print(b)
elif k == 3:
f = open("prince_logex.txt")
b = f.read()
print(b)
elif c==2:
if k == 1:
f = open("meet_logfood.txt")
b = f.read()
print(b)
elif k == 2:
f = open("zenith_logfood.txt")
b = f.read()
print(b)
elif k == 3:
f = open("prince_logfood.txt")
b = f.read()
print(b)
n=int(input("1 meet 2 zenith 3 prince:"))
a=int(input("enter 1 log 2 retrive:"))
if a==1:
log(n)
elif a==2:
retrive(n)