What is the use of join

0 votes
Python join() method
Jun 20, 2019 in Python by Nisa
• 1,090 points
677 views

1 answer to this question.

0 votes
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
answered Jun 20, 2019 by Wajiha
• 1,960 points

Related Questions In Python

+2 votes
3 answers

what is the practical use of polymorphism in Python?

Polymorphism is the ability to present the ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,440 points
4,937 views
0 votes
2 answers

What is the use of Python language?

python is general purpose programming language.it very ...READ MORE

answered Mar 15, 2019 in Python by rajesh kumar
1,088 views
0 votes
1 answer

What is the use of raw_input function in Python?

raw_input fuction is no longer available in ...READ MORE

answered May 2, 2018 in Python by aayushi
• 750 points
1,295 views
0 votes
1 answer

What is the use of “assert” keyword in Python?

You can try the following in a ...READ MORE

answered Oct 15, 2018 in Python by Priyaj
• 58,020 points
1,094 views
0 votes
0 answers

what is the use of args and kwargs in python?

can you an example for each? READ MORE

May 11, 2019 in Python by Waseem
• 4,540 points
720 views
0 votes
0 answers

What is the use of get requests in python?

What are the other http requests in ...READ MORE

May 30, 2019 in Python by Waseem
• 4,540 points
497 views
0 votes
0 answers

what is the use of python math module?

what are different functions that we can ...READ MORE

Jun 7, 2019 in Python by Waseem
• 4,540 points
726 views
0 votes
1 answer

What is timedelta in python?

It represents a duration which is basically ...READ MORE

answered Aug 7, 2019 in Python by Wajiha
• 1,960 points
776 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP