-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path32_2.exrecise.py
More file actions
115 lines (99 loc) · 4.05 KB
/
Copy path32_2.exrecise.py
File metadata and controls
115 lines (99 loc) · 4.05 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
def gettime():
import datetime
return datetime.datetime.now()
def log():
print("Choose your client")
client = int(input("1. Harry \n2. Rohan \n3. Hammad"))
con = 1
if client == 1:
while con == 1:
print("What do you want to log for Harry?")
choice = int(input("1. Diet \n2. Activity"))
if choice == 1:
f = open("Harry_diet.txt", "a")
data = input("Enter what has Harry Eaten?")
f.write(str([str(gettime())]) + " " + data + "\n")
# f.close()
else:
f = open("Harry_exercise.txt", "a")
data = input("How much time has Harry worked out?")
f.write(str([str(gettime())]) + " " + data + "\n")
# f.close()
con = int(input("Do you want to log more for Harry? \n1. Yes \n2. No"))
elif client == 2:
while con == 1:
print("What do you want to log for Rohan?")
choice = int(input("1. Diet \n2. Activity"))
if choice == 1:
f = open("rohan diet.txt", "a")
data = input("Enter what has Rohan Eaten?")
f.write(str([str(gettime())]) + " " + data + "\n")
# f.close()
else:
f = open("rohan exercise.txt", "a")
data = input("How much time has Rohan worked out?")
f.write(str([str(gettime())]) + " " + data + "\n")
# f.close()
con = int(input("Do you want to log more for Rohan? \n1. Yes \n2. No"))
elif client == 3:
while con == 1:
print("What do you want to log for Hammad?")
choice = int(input("1. Diet \n2. Activity"))
if choice == 1:
f = open("hammad diet.txt", "a")
data = input("Enter what has Hammad Eaten?")
f.write(str([str(gettime())]) + " " + data + "\n")
# f.close()
else:
f = open("hammad exercise.txt", "a")
data = input("How much time has Hammad worked out?")
f.write(str([str(gettime())]) + " " + data + "\n")
# f.close()
con = int(input("Do you want to log more for Hammad? \n1. Yes \n2. No"))
def retrieve():
con = 1
while con == 1:
print("Choose your client")
client = int(input("1. Harry \n2. Rohan \n3. Hammad"))
if client == 1:
print("What do you want to retrieve for Harry?")
choice = int(input("1. Diet \n2. Activity"))
if choice == 1:
f = open("Harry_diet.txt", "r")
print(f.readlines())
# f.close()
else:
f = open("Harry_exercise.txt", "r")
print(f.readlines())
# f.close()
elif client == 2:
print("What do you want to retrieve for Rohan?")
choice = int(input("1. Diet \n2. Activity"))
if choice == 1:
f = open("rohan diet.txt", "r")
print(f.readlines())
# f.close()
else:
f = open("rohan exercise.txt", "r")
print(f.readlines())
# f.close()
elif client == 3:
print("What do you want to retrieve for Hammad?")
choice = int(input("1. Diet \n2. Activity"))
if choice == 1:
f = open("hammad diet.txt", "r")
print(f.readlines())
# f.close()
else:
f = open("hammad exercise.txt", "r")
print(f.readlines())
# f.close()
con = int(input("Do you want to retrieve any more details? \n1. Yes \n2. No"))
print("Welcome to Health care Management System")
ch = int(input("What do you want to do? \n1. Log \n2. Retrieve"))
if ch == 1:
log()
elif ch == 2:
retrieve()
else:
print("Wrong Input. Please try again.")