hi again
i have this code:
#this program is a simple test OS for a till
#it will loop constantly until a certain time (specified as CLOSING_TIME) COMPLETED!!!
#it will check stock from a dictionary in a file (specified as STOCK)
#i plan to add a profit calculator
import time
OPENING_TIME = '17:17:30'
CLOSING_TIME = '17:17:59'
current_time = time.asctime()[11:19]
def isopen(opening_time):
current_time = time.asctime()[11:19]
while current_time < OPENING_TIME:
current_time = time.asctime()[11:19]
time.sleep(1)
print("we are now open")
def maintill(closing_time):
while 1:
current_time = time.asctime()[11:19]
while current_time < CLOSING_TIME:
current_time = time.asctime()[11:19]
print("we are closing now, please leave the store.")
break
isopen(OPENING_TIME)
maintill(CLOSING_TIME)
i now want to add in a basic till into the maintill(closing_time) function but im worried that it will hang until someone finishes inputting data, thus not allowing it to update closing_time. how could i stop this from happening?