Advertisement
kestutisma

Untitled

Mar 26th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import threading
  2.  
  3. class MyThread():
  4.     def start(self):
  5.         self._thread = threading.Thread(target=self.run)
  6.         self._thread.start()
  7.  
  8.     def run(self):
  9.         print("thread started.")
  10.  
  11. def run():
  12.     myThread = MyThread()
  13.     myThread.start()        
  14.  
  15. if __name__ == '__main__':
  16.     run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement