-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhealth managment.py
More file actions
84 lines (83 loc) · 3.13 KB
/
health managment.py
File metadata and controls
84 lines (83 loc) · 3.13 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
import datetime
def gettime():
return datetime.datetime.now()
def take(k):
if k==1:
c=int(input("enter 1 for excersise and 2 for food"))
if(c==1):
value=input("type here\n")
with open("harry-ex.txt","a") as op:
op.write(str([str(gettime())])+": "+value+"\n")
print("successfully written")
elif(c==2):
value = input("type here\n")
with open("harry-food.txt", "a") as op:
op.write(str([str(gettime())]) + ": " + value + "\n")
print("successfully written")
elif(k==2):
c = int(input("enter 1 for excersise and 2 for food"))
if (c == 1):
value = input("type here\n")
with open("rohan-ex.txt", "a") as op:
op.write(str([str(gettime())]) + ": " + value + "\n")
print("successfully written")
elif (c == 2):
value = input("type here\n")
with open("rohan-food.txt", "a") as op:
op.write(str([str(gettime())]) + ": " + value + "\n")
print("successfully written")
elif(k==3):
c = int(input("enter 1 for excersise and 2 for food"))
if (c == 1):
value = input("type here\n")
with open("hammad-ex.txt", "a") as op:
op.write(str([str(gettime())]) + ": " + value + "\n")
print("successfully written")
elif (c == 2):
value = input("type here\n")
with open("hammad-food.txt", "a") as op:
op.write(str([str(gettime())]) + ": " + value + "\n")
print("successfully written")
else:
print("plz enter valid input (1(harry),2(rohan),3(hammad)")
def retrieve(k):
if k==1:
c=int(input("enter 1 for excersise and 2 for food"))
if(c==1):
with open("harry-ex.txt") as op:
for i in op:
print(i,end="")
elif(c==2):
with open("harry-food.txt") as op:
for i in op:
print(i, end="")
elif(k==2):
c = int(input("enter 1 for excersise and 2 for food"))
if (c == 1):
with open("rohan-ex.txt") as op:
for i in op:
print(i, end="")
elif (c == 2):
with open("rohan-food.txt") as op:
for i in op:
print(i, end="")
elif(k==3):
c = int(input("enter 1 for excersise and 2 for food"))
if (c == 1):
with open("hammad-ex.txt") as op:
for i in op:
print(i, end="")
elif (c == 2):
with open("hammad-food.txt") as op:
for i in op:
print(i, end="")
else:
print("plz enter valid input (harry,rohan,hammad)")
print("health management system: ")
a=int(input("press 1 for lock the value and 2 for retrieve "))
if a==1:
b = int(input("press 1 for harry 2 for rohan 3 for hammad "))
take(b)
else:
b = int(input("press 1 for harry 2 for rohan 3 for hammad "))
retrieve(b)