thread.py 211 B

1234567891011
  1. import threading
  2. import time
  3. def proc(n, s):
  4. while True:
  5. print('Поток №:', n)
  6. time.sleep(s)
  7. threading.Thread(target=proc, args=[1, 1]).start()
  8. threading.Thread(target=proc, args=[2, 1.5]).start()