Hi, how would I get the timer() class to change time display()'s self.time
I'm new to threads and classes and have been sitting here thinking about it for the last half hour and still have know idea
Thanks heaps for any help.
# Count down timer
import time
import threading
loop = 1
class time_display(object):
def __init__(self):
self.time = 30
def print_time(self):
while self.time > 0:
print self.time
raw_input("Push ENTER to re-check the time")
class timer(threading.Thread):
def run(self):
while loop == 1:
time.sleep(1.0)
# Add something here to decrease the time by 1
timer1 = time_display()
timer2 = timer()
timer2.start()
timer1.print_time()
# I don't know the command to end threads but this sounds right?
timer2.end()