import threading import time def thread_job(): print("T1 start ") for i in range(30): time.sleep(0.1) print("T1 finish ") def T2_job(): print("T2 start ") print("T2 finish ") def main(): added_thread =threading.Thread(target=thread_job,name="T1") thread2 = threading.Thread(target=T2_job,name="T2") added_thread.start() thread2.start() thread2.join() added_thread.join() print('all done ') if __name__=="__main__": main()