Ahaha, it is a pretty normal thing in my city, I forget that not everyone has heard about it An escape room is basically a room that a group of 4 - 8 people are "locked" into (the door is never actually locked) and you have to solve a series of puzzles and riddles to get out before the time limit (usually 60 minutes). For example, you're locked in a spaceship with only 60 minutes of oxygen, or you have 60 minutes to get out of prison, that kind of thing. You should give one a try if there are any nearby you, I think they're a blast!Heater wrote:Good grief, that is curious. What is an "escape room"? Or an "escape room business"? You say that as if it is some kind of normal thing like "my family owns a trucking company"
Code: Select all
#!/usr/bin/python from Tkinter import * import time rootWindow = Tk() rootWindow.title('Tk Timer') rootWindow.geometry("300x250") rootWindow.resizable(0,0) defaultColour = rootWindow.cget("bg") time1 = '' prevSec = '' mins = 0 secs = 0 hours = 1 running = False #clock = Label(rootWindow, font=('fixed', 20, 'bold')) clock = Label(rootWindow, font=('fixed', 20)) clock.grid(row = 1, column = 2, padx = 5, pady = (5,2)) def tick(): global prevSec, time1, secs, mins, hours, running # get the current local time from the PC # time2 = time.strftime('%Y/%m/%d %H:%M:%S') if running: newSec = time.strftime('%S') else: newSec = '' prevSec = '' if newSec != prevSec: prevSec = newSec secs = secs - 1 if secs < 0: secs = 59 mins = mins - 1 if mins < 0: mins = 59 hours = hours - 1 if hours < 0: hours = 0 mins = 0 secs = 0 clock.config(bg='dark red') time2 = '%02d:%02d:%02d' % (hours, mins, secs) # if time string has changed, update it if time2 != time1: time1 = time2 clock.config(text=time2) # calls itself every 200 milliseconds # to update the time display as needed # could use >200 ms, but display gets jerky clock.after(200, tick) tick() def start_btn(): global running clock.config(bg='green') btn_start.config(state='disabled',background=defaultColour) btn_stop.config(state='normal',bg='dark red') btn_reset.config(state='disabled') running = True def stop_btn(): global running clock.config(bg='dark red') btn_start.config(state='normal',bg='green') btn_stop.config(state='disabled',bg=defaultColour) btn_reset.config(state='normal') running = False def reset_btn(): global prevSec, time1, secs, mins, hours, running clock.config(bg=defaultColour) hours = 2 mins = 0 secs = 0 prevSec = '' time1 = '' running = False btn_stop.config(state='disabled',bg=defaultColour) btn_start.config(state='normal',bg='green') btn_reset.config(state='disabled') btn_reset = Button(rootWindow, state='disabled', text = 'Reset', command = reset_btn) btn_reset.grid(sticky=EW, row = 1, column = 3, padx = 5, pady = (5,2)) btn_start = Button(rootWindow, text = 'Start', bg='green', command = start_btn) btn_start.grid(sticky=EW, row = 2, column = 3, padx = 5, pady = 2) btn_stop = Button(rootWindow, state='disabled', text = 'Stop', command = stop_btn) btn_stop.grid(sticky=EW, row = 3, column = 3, padx = 5, pady = (2,5)) btn_exit = Button(rootWindow, text = 'exit', command = exit) btn_exit.grid(row = 4, column = 1, padx = 5, pady = 5) rootWindow.mainloop()
Time to find your coding pad and sharpen your coding pencil.