Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class myClass(object):
- watcher = None
- @staticmethod
- def launch():
- th = Thread(target = myClass.watcherThread, name = "myClass watcher thread")
- th.daemon = True
- th.start()
- myClass.watcher = th
- @staticmethod
- def stop():
- myClass.watcher = None
- @staticmethod
- def watcherThread():
- while(true):
- #some code
- if(myClass.watcher == None):
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement