Join() function is used in threading to make the main thread wait for the child thread to finish before taking the control from it.
Example:
import threading
import time
class mythread(threading.Thread):
def run(self):
for x in range(7):
print("Hi from child")
a = mythread()
a.start()
a.join()
print("Bye from",current_thread().getName())
Output:
Hi from child
Hi from child
Hi from child
Hi from child
Hi from child
Hi from child
Hi from child
Bye from MainThread