fork download
  1. import threading
  2. import time
  3.  
  4. def a():
  5. th = threading.Thread(target=b)
  6. th.start()
  7. print('end a')
  8.  
  9. def b():
  10. time.sleep(2)
  11. print('end b')
  12.  
  13. a()
  14. time.sleep(4)
  15. print('end main')
  16.  
Success #stdin #stdout 0.07s 18592KB
stdin
Standard input is empty
stdout
end a
end b
end main