×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Co San
Added: Aug 7, 2017 1:42 PM
Views: 11
Tags: threading
  1. import threading
  2. import time
  3.  
  4.  
  5. def some_func():
  6.     while True:
  7.         time.sleep(1)
  8.         print("Test 1")
  9.  
  10. task = threading.Thread(target=some_func)
  11. task.start()
  12.  
  13. while True:
  14.     time.sleep(1)
  15.     print("Test 2")