Advertisement
Guest User

Untitled

a guest
Jan 25th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement