HEALTH MANAGEMENT SYSTEM
def getdate():
import datetime
a= str(datetime.datetime.now())
return a
print('What do you want \n1-log\n2-revert')
print()
user1 = int(input('=>'))
if user1==1:
print()
print("For whome\n1-rishabh\n2-kana\n3-sam")
print()
user2 = int(input('=>'))
print()
if user2==1:
print('For what\n1-exercise\n2-food')
print()
user3 = int(input('=>'))
print()
if user3==1:
inp=input('Enter exercise\n')
with open('exrishu.txt','w') as exr:
exr.write("[")
exr.write(getdate())
exr.write("] ")
exr.write(inp)
elif user3==2:
inp=input('Enter food\n')
with open('fdrishu.txt','w') as fdr:
fdr.write("[")
fdr.write(getdate())
fdr.write("] ")
fdr.write(inp)
else:
print('You enter the wrong value')
elif user2==2:
print('For what\n1-exercise\n2-food')
print()
user3 = int(input('=>'))
print()
if user3==1:
inp=input('Enter exercise\n')
with open('exkana.txt','w') as exk:
exk.write("[")
exk.write(getdate())
exk.write("] ")
exk.write(inp)
elif user3==2:
inp=input('Enter food\n')
with open('fdkana.txt','w') as fdk:
fdk.write("[")
fdk.write(getdate())
fdk.write("] ")
fdk.write(inp)
else:
print('You enter the wrong value')
elif user2==3:
print('For what\n1-exercise\n2-food')
print()
user3 = int(input('=>'))
print()
if user3==1:
inp=input('Enter exercise\n')
with open('exsam.txt','w') as exs:
exs.write("[")
exs.write(getdate())
exs.write("] ")
exs.write(inp)
elif user3==2:
inp=input('Enter food\n')
with open('fdsam.txt','w') as fds:
fds.write("[")
fds.write(getdate())
fds.write("] ")
fds.write(inp)
else:
print('You enter the wrong value')
else:
print('You enter the wrong value')
elif user1==2:
print()
print("For whome\n1-rishabh\n2-kana\n3-sam")
print()
user2 = int(input('=>'))
print()
if user2==1:
print('For what\n1-exercise\n2-food')
print()
user3 = int(input('=>'))
print()
if user3==1:
with open('exrishu.txt','rt') as exr:
print(exr.read())
elif user3==2:
with open('fdrishu.txt','rt') as fdr:
print(fdr.read())
else:
print("You enter the wrong value")
elif user2==2:
print('For what\n1-exercise\n2-food')
print()
user3 = int(input('=>'))
print()
if user3==1:
with open('exkana.txt','rt') as exk:
print(exk.read())
elif user3==2:
with open('fdkana.txt','rt') as fdk:
print(fdk.read())
else:
print('You enter a wrong value')
elif user2==3:
print('For what\n1-exercise\n2-food')
print()
user3 = int(input('=>'))
print()
if user3==1:
with open('exsam.txt','rt') as exs:
print(exs.read())
elif user3==2:
with open('fdsam.txt','rt') as fds:
print(fds.read())
else:
print('You enter the wrong value')
else:
print('You enter the wrong value')