daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Jul 13th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class MyThread(Thread):
  2.         def __init__(self, event)):
  3.             Thread.__init__(self)
  4.             self.stopped = event
  5.  
  6.         def run(self):
  7.                     while not self.stopped.wait(1): # 1 second for sake of example
  8.  
  9.  
  10.                             self.task()
  11.  
  12.         def task(self):
  13.                     print("my long task")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top