-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProject-1-Health-Managment-system.py
107 lines (88 loc) · 3.38 KB
/
Project-1-Health-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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#Health Management System
def getdate():
import datetime
return datetime.datetime.now()
#now code start
import datetime
def gettime():
return datetime.datetime.now()
def take(k):
if (k==1):
c=int(input("Enter 1 for Exercise 2 For Food"))
if (c==1):
value=input("Type here\n")
with open("manish-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("manish-food.txt","a") as op:
op.write(str([str(gettime())])+": "+value+"\n")
print("Successfully written : ")
elif (k==2):
c=int(input("Enter 1 for Exercise 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==3):
c=int(input("Enter 1 for Exercise 2 For Food"))
if (c==1):
value=input("Type here\n")
with open("ankit-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("ankit-food.txt","a") as op:
op.write(str([str(gettime())])+": "+value+"\n")
print("Successfully written")
else:
print("plz enter valid input (1(manish),2(harry),3(ankit)")
def retrive(k):
if (k==1):
c=int(input("Enter 1 for Exercise 2 For Food"))
if (c==1):
with open("manish-ex.txt") as op:
for i in op:
print(i,end="")
elif(c==2):
with open("manish-food.txt") as op:
for i in op:
print(i,end="")
elif(k==2):
c=int(input("Enter 1 for Exercise 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==3):
c=int(input("Enter 1 for Exercise 2 For Food"))
if (c==1):
with open("ankit-ex.txt") as op:
for i in op:
print(i,end="")
elif(c==2):
with open("ankit-food.txt") as op:
for i in op:
print(i,end="")
else:
print("plz enter valid input (manish,harry,ankit)")
print("*******Health Management System*******")
a=int(input("Press 1 for log and 2 For retrive "))
if a==1:
b=int(input("Press 1 for Manish 2 for Harry 3 for Ankit "))
take(b)
else:
b=int(input("Press 1 for Manish 2 for Harry 3 for Ankit "))
retrive(b)