-
Notifications
You must be signed in to change notification settings - Fork 0
/
healthManagermentSystem.py
94 lines (83 loc) · 3.08 KB
/
healthManagermentSystem.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
import datetime
def gettime():
return datetime.datetime.now()
def take(k):
if k==1:
c=int(input("Enter 1 for Exercise and 2 for Food \n "))
if c==1:
value=input("Type here \n")
with open("vishal-ex.txt","a") as op:
op.write(str([str(gettime())]) + " : " + value + " \n ")
print("Sucessfully written")
elif c==2:
value= input("Type here \n")
with open("vishal-food.txt","a") as op:
op.write(str([str(gettime)])+ " : " + value + " \n ")
print("Sucessful written")
elif k==2:
c=int(input("Enter 1 for Exercise and 2 for Food \n "))
if c==1:
value=input("Type here \n")
with open("prashant-ex.txt","a") as op:
op.write(str([str(gettime())]) + " : " + value + " \n ")
print("Sucessfully written")
elif c==2:
value= input("Type here \n")
with open("prashant-food.txt","a") as op:
op.write(str([str(gettime)])+ " : " + value + " \n ")
print("Sucessful written")
elif k==3:
c=int(input("Enter 1 for Exercise and 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("Sucessfully 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("Sucessful written")
else:
print("Please enter valid input 1 (Vishal) , 2 (Prashant), 3 (Shivam)")
def retrieve(k):
if k==1:
c=int(input("Enter 1 for Exercise and 2 for Food \n"))
if c==1:
with open("vishal-ex.txt")as op:
for i in op:
print(i, end=" ")
elif c==2:
with open("vishal-food.txt")as op:
for i in op:
print(i, end=" ")
elif k==2:
c=int(input("Enter 1 for Exercise and 2 for Food \n"))
if c==1:
with open("prashant-ex.txt")as op:
for i in op:
print(i, end=" ")
elif c==2:
with open("prashant-food.txt")as op:
for i in op:
print(i, end=" ")
elif k==3:
c=int(input("Enter 1 for Exercise and 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=" ")
else:
print("Please enter valid input (Vishal ,Prashant ,Shivam)")
print("Health Managment System")
a= int(input("Press 1 for write the Value and 2 for retrive \n"))
if a==1:
b= int(input("Press 1 for Vishal\n 2 for Prashant\n 3 for Shivam "))
take(b)
else:
b= int(input("Press 1 for Vishal\n 2 for Prashant\n 3 for Shivam "))
retrieve(b)