-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHealth_Management_System_in_Python.py
More file actions
54 lines (44 loc) · 1.61 KB
/
Copy pathHealth_Management_System_in_Python.py
File metadata and controls
54 lines (44 loc) · 1.61 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
# Health Management System
client_list = {1:'Kamlesh', 2:'Ridhima', 3:'Kavi'} # this is Dictionary
log_list = {1:'Exercise', 2:'Diet'}
def getdate():
import datetime
return datetime.datetime.now()
try:
print("Select the Client Name")
for key,value in client_list.items():
print("Press",key, "for",value,"\n",end='')
client_name = int(input())
print("Selected Client : ",client_list[client_name])
print("Press 1 for Log")
print("Press 2 for Retrive")
op = int(input())
if op == 1:
for Key,Value in log_list.items():
print("Select",Key,"for",Value,"\n",end='')
log_name = int(input())
print("Selected Job is : ",log_list[log_name])
f = open(client_list[client_name] + "_" + log_list[log_name] + ".txt","a")
k='y'
while k != 'n':
print("Enter",log_list[log_name])
mytext = input()
f.write("["+ str(getdate()) + "]" + mytext + "")
k = input("ADD MORE ? y/n:")
continue
f.close()
elif op == 2:
for Key,Value in log_list.items():
print("Select",Key,"for",Value,"\n",end='')
log_name = int(input())
print("Selected Job is : ",log_list[log_name])
print(client_list[client_name] +"_"+ log_list[log_name],"Report : \n", end='')
f = open(client_list[client_name]+"_"+log_list[log_name] +".text",'r')
contents = f.readlines()
for data in contents:
print(data,end='')
f.close()
else:
print("Invalid Input !!!")
except Exception as e:
print("Wrong input !!!")