Health Management System Project
#log for kartik
import datetime
def gettime():
return datetime.datetime.now()
def LogValue(a):
if (a==1):
c=int(input("1 for food and 2 for excercise\t"))
if (c==1):
name=int(input("1 for ayush 2 for jay 3 for kartik\t"))
if (name==1):
food=input("Aysuh write your food\n")
with open("ayush.txt",'a') as f:
f.write(str([str(gettime())])+": "+food+"\n")
print("Successfuly Writen")
elif (name==2):
food=input("Jay write your food\t")
with open("Jay.txt",'a') as f:
f.write(str([str(gettime())])+": "+food+"\n")
print("Successfuly Writen")
elif (name==3):
food=input("kartik write your food\t")
with open("kartik.txt",'a') as f:
f.write(str([str(gettime())])+": "+food+"\n")
print("Successfuly Writen")
if (c==2):
name=int(input("1 for ayush 2 for jay 3 for kartik\t"))
if (name==1):
excercise=input("Aysuh write your Excercise\t")
with open("ayush_Ex.txt",'a') as f:
f.write(str([str(gettime())])+": "+excercise+"\n")
print("Successfuly Writen")
elif (name==2):
excercise=input("Jay write your Excercise\t")
with open("Jay_Ex.txt",'a') as f:
f.write(str([str(gettime())])+": "+excercise+"\n")
print("Successfuly Writen")
elif (name==3):
excercise=input("kartik write your Excercise\t")
with open("kartik_Ex.txt",'a') as f:
f.write(str([str(gettime())])+": "+excercise+"\n")
print("Successfuly Writen")
def RetriveValue(a):
if (a==2):
c=int(input("1 for food and 2 for excercise\t"))
if (c==1):
name=int(input("1 for ayush 2 for jay 3 for kartik\t"))
if (name==1):
with open("ayush.txt") as f:
k=f.read()
print(k)
elif (name==2):
with open("Jay.txt",'r') as f:
k=f.read()
print(k)
elif (name==3):
with open("kartik.txt",'r') as f:
k=f.read()
print(k)
if (c==2):
name=int(input("1 for ayush 2 for jay 3 for kartik\t"))
if (name==1):
with open("ayush_Ex.txt",'r') as f:
p=f.read()
print(p)
elif (name==2):
with open("Jay_Ex.txt",'r') as f:
p=f.read()
print(p)
elif (name==3):
with open("kartik_Ex.txt",'r') as f:
p=f.read()
print(p)
print("! Wecome In Management System !")
a=int(input("1 for log and 2 for retrive\t"))
LogValue(a)
RetriveValue(a)
Comments
Post a Comment