-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHealth Management system.py
94 lines (86 loc) · 3.2 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
85
86
87
88
89
90
91
92
93
94
def getdate():
import datetime
return datetime.datetime.now()
import datetime
def gettime():
return datetime.datetime.now()
def take(z): # Take input from user
if z==1:
c = int(input("Enter 1 for Exercise and 2 for Food "))
if(c == 1)
value=input("Type Here\n ")
with open("Abdullah-kasrat.txt","a") as op:
op.write(str([str(gettime())])+": " +value+ "\n")
print("Successfully written ")
if(c == 2)
value=input("Type Here\n ")
with open("Abdullah-Khana.txt","a") as op:
op.write(str([str(gettime())])+": " +value+ "\n")
print("Successfully written ")
if z==2:
c = int(input("Enter 1 for Exercise and 2 for Food "))
if(c == 1)
value=input("Type Here\n ")
with open("Rohan-kasrat.txt","a") as op:
op.write(str([str(gettime())])+": " +value+ "\n")
print("Successfully written ")
if(c == 2)
value=input("Type Here\n ")
with open("Rohan-Khana.txt","a") as op:
op.write(str([str(gettime())])+": " +value+ "\n")
print("Successfully written ")
if z==3:
c = int(input("Enter 1 for Exercise and 2 for Food "))
if(c == 1)
value=input("Type Here\n ")
with open("Hammad-kasrat.txt","a") as op:
op.write(str([str(gettime())])+": " +value+ "\n")
print("Successfully written ")
if(c == 2)
value=input("Type Here\n ")
with open("Hammad-Khana.txt","a") as op:
op.write(str([str(gettime())])+": " +value+ "\n")
print("Successfully written ")
else:
print("Please Enter valid input [1 for Abdullah, 2 for Rohan or 3 for Hammad ]")
def retrieve(z): # show output
if z==1:
c = int(input("Enter 1 for Exesise and 2 for Food "))
if(c==1):
with open("Abdullah-exersise.txt") as op:
for i in op:
print(i,end="")
elif(c==2):
with open("Abdullah-Food.txt") as op:
for i in op:
print(i, end="")
elif(z==2):
c = int(input("Enter 1 for exersise and 2 for Food "))
if(c==1):
with open("Rohan-exersise.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(z==3):
c = int(input("Enetr 1 for Exercise and 2 for Food "))
if(c==1):
with open("Hammad-exersise.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("Please Enter valid input (Abdullah, Rohan , Hammad)")
print(" Health Management System ")
a = int(input("Press 1 for log the value and 2 for retrive "))
if a == 1:
b = int(input("Press 1 for Abdullah 2 for Rohan 3 for Hammad "))
take(b)
else:
b = int(input("Press 1 for Abdullah 2 for Rohan 3 for Hammad "))
retrieve(b)