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