SHARE
TWEET

Untitled

a guest Jan 25th, 2016 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class myClass(object):
  2.     watcher = None
  3.    
  4.     @staticmethod
  5.     def launch():
  6.         th = Thread(target = myClass.watcherThread, name = "myClass watcher thread")
  7.         th.daemon = True
  8.         th.start()
  9.         myClass.watcher = th
  10.  
  11.     @staticmethod
  12.     def stop():
  13.         myClass.watcher = None 
  14.  
  15.     @staticmethod
  16.     def watcherThread():
  17.         while(true):
  18.  
  19.             #some code
  20.  
  21.             if(myClass.watcher == None):
  22.                 break
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