-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhealth_management.py
More file actions
94 lines (83 loc) · 3.37 KB
/
health_management.py
File metadata and controls
94 lines (83 loc) · 3.37 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
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
import datetime
def gettime():
return datetime.datetime.now()
def log():
b = int(input("Enter a number 1 for Harry 2 for Jhon"))
if b==1:
c = int(input("Enter a number 1 for food 2 for exercise"))
if c==1:
d=int(input("How many Items you want to add"))
print("Enter The Food Items")
while d>0:
e = input()
with open("harryfood.txt","a") as har:
har.write(str([str(gettime())])+":"+e+"\n")
d=d-1
print("Items successfully Added")
elif c==2:
h=int(input("How many Items you want to add"))
print("Enter The Exercises")
while h>0:
i = input()
with open("harryexe.txt","a") as har:
har.write(str([str(gettime())])+":"+i+"\n")
h = h-1
print("Items successfully Added")
else:
print("Invalid Enter")
elif b==2:
j = int(input("Enter a number 1 for food 2 for exercise"))
if j==1:
k=int(input("How many Items you want to add"))
print("Enter The Food Items")
while k>0:
l = input()
with open("Jhonfood.txt","a") as har:
har.write(str([str(gettime())])+":"+l+"\n")
k=k -1
print("Items successfully Added")
elif j==2:
m=int(input("How many Items you want to add"))
print("Enter The Exercises")
while m>0:
n = input()
with open("Jhonexe.txt","a") as har:
har.write(str([str(gettime())])+":"+n+"\n")
m=m-1
print("Items successfully Added")
else:
print("invalid Enter")
else:
print("invalid Enter")
def retrieve():
f = int(input("Enter a number 1 for Harry 2 For Jhon"))
if f==1:
g = int(input("Enter A number 1 for food 2 for exercise"))
if g==1:
with open("harryfood.txt") as hf:
print(hf.read())
elif g==2:
with open("harryexe.txt") as hf:
print(hf.read())
else:
print("Invalid Enter")
elif f==2:
o = int(input("Enter A number 1 for food 2 for exercise"))
if o==1:
with open("Jhonfood.txt") as hf:
print(hf.read())
elif o==2:
with open("Jhonexe.txt") as hf:
print(hf.read())
else:
print("Invalid enter")
else:
print("Invalid Enter")
print("Enter A Number 1 for log 2 for retrieve")
a = int(input())
if a==1:
log()
elif a==2:
retrieve()
else:
print("please restart and enter 1 or 2")