-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhealt_managment_system.py
85 lines (83 loc) · 3.16 KB
/
healt_managment_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 take(k):
if k==1:
c=int(input("Enter 1 for excersise \nEnter 2 for food\n"))
if(c==1):
value=input("type here\n")
with open("shivam-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("shivam-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 \nEnter 2 for food\n"))
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 \nEnter 2 for food \n"))
if (c == 1):
value = input("type here\n")
with open("Abhishek-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("Abhishek-food.txt", "a") as op:
op.write(str([str(gettime())]) + ": " + value + "\n")
print("successfully written")
else:
print("plz Enter valid input (1(shivam),2(rohan),3(Abhishek)")
def retrieve(k):
if k==1:
c=int(input("Enter 1 for excersise \nEnter 2 for food\n"))
if(c==1):
with open("shivam-ex.txt") as op:
for i in op:
print(i,end="")
elif(c==2):
with open("shivam-food.txt") as op:
for i in op:
print(i, end="")
elif(k==2):
c = int(input("Enter 1 for excersise \nEnter 2 for food\n"))
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 \nEnter 2 for food\n"))
if (c == 1):
with open("Abhishek-ex.txt") as op:
for i in op:
print(i, end="")
elif (c == 2):
with open("Abhishek-food.txt") as op:
for i in op:
print(i, end="")
else:
print("plz Enter valid input (shivam,rohan,Abhishek)")
print("health management system: ")
a=int(input("press 1 for log the value \npress 2 for retrieve \n "))
if a==1:
b = int(input("press 1 for shivam \npress 2 for rohan \npress 3 for Abhishek \n "))
take(b)
else:
b = int(input("press 1 for shivam \npress 2 for rohan \npress 3 for Abhishek \n"))
retrieve(b)