Skip to content

Instantly share code, notes, and snippets.

@Deep18-03
Last active June 3, 2020 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deep18-03/8c89c9663b09305d523db860d1c58701 to your computer and use it in GitHub Desktop.
Save Deep18-03/8c89c9663b09305d523db860d1c58701 to your computer and use it in GitHub Desktop.
#hotem managemnet system
client_list={1:"harry",2:"carry",3:"danny"}
lock_list={1:"exercise",2:"food"}
import datetime
def gettime():
return datetime.datetime.now()
def lock(op):
for key,value in lock_list.items():
print("press "+ str(key)+" for "+value)
lock_name=int(input())
print("selected job is "+lock_list[lock_name])
f=open(client_list[client_name]+"-"+lock_list[lock_name]+".txt","a")
k='y'
while(k is not "n"):
value=input("enter the text"+"\t")
f.write(str(gettime())+":"+value+"\n")
k=input("do you want to add more ? y/n"+"\t")
continue
f.close()
def retrive(op):
for key,value in lock_list.items():
print("press"+str(key)+"for"+value)
lock_name=int(input())
with open(client_list[client_name]+"-"+lock_list[lock_name]+".txt") as f:
content=f.read()
print(content)
f.close()
print("select client name")
for key,value in client_list.items():
print("press "+str(key)+" for "+value)
client_name=int(input())
print("selected client "+client_list[client_name]+"\n")
print("press 1 for lock \n press 2 for retrive")
op=int(input())
if op==1:
lock(op)
else:
retrive(op)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment