def __init__(self): super(ProblemWatchThread, self).__init__() self.pwatch = problem.get_problem_watcher() self.pwatch.add_callback(self.handle) self.probcount = 0
import sys import problem def monitor(prob): print(prob) sys.stdout.flush() pwatch = problem.get_problem_watcher() pwatch.add_callback(monitor) pwatch.run()