The right program is as following,everything is ok.<br>import requests<br>import threading<br>import queue<br><br>class  webdata(object):<br>    def  __init__(self,name):<br>        self.jobs=queue.Queue()<br>        for  x  in  name:<br>            url='http://stockhtm.finance.qq.com/sstock/ggcx/%s.shtml'  %x<br>            self.jobs.put(url)<br>    def  download(self):<br>        while not self.jobs.empty():<br>            try:<br>                url = self.jobs.get()<br>                print(requests.get(url).status_code,url)<br>                print(threading.currentThread())              <br>                self.jobs.task_done()<br>            except:<br>                print("wrong",url)<br>                self.jobs.task_done()<br>    def  run(self):<br>         for i in range(3):<br>              threading.Thread(target=self.download).start()<br>        self.jobs.join()<br>         print("i am over")<br><br><br>name=['600000', '000001', '600319', '600531','600661', '600983', '600202', '600149']<br>x=webdata(name)<br>x.run()<span id="_editor_bookmark_start_26" style="display: none; line-height: 0px;">‍</span><br><br>question1:<br><br>when i delete the line of `self.jobs.join()<span id="_editor_bookmark_start_13" style="display: none; line-height: 0px;">‍</span>` ,the program will never finished ,why? <br><br>import requests<br>import threading<br>import queue<br><br>class  webdata(object):<br>    def  __init__(self,name):<br>        self.jobs=queue.Queue()<br>        for  x  in  name:<br>            url='http://stockhtm.finance.qq.com/sstock/ggcx/%s.shtml'  %x<br>            self.jobs.put(url)<br>    def  download(self):<br>        while not self.jobs.empty():<br>            try:<br>                url = self.jobs.get()<br>                print(requests.get(url).status_code,url)<br>                print(threading.currentThread())              <br>                self.jobs.task_done()<br>            except:<br>                print("wrong",url)<br>                self.jobs.task_done()<br>    def  run(self):<br>         for i in range(3):<br>              threading.Thread(target=self.download).start()<br>        self.jobs.join()<br>         print("i am over")<br><br><br>name=['600000', '000001', '600319', '600531','600661', '600983', '600202', '600149']<br>x=webdata(name)<br>x.run()<span id="_editor_bookmark_start_0" style="display: none; line-height: 0px;">‍</span><br><br><img src="cid:08221DA3@7B7BB14B.140BD253.PNG"><br>never quit from the thread ,why?<br><br>question2:<br><br><br>I can get every son-thread thread number with   `print(threading.currentThread())  `,how can i get the main thread number in the program?       <span id="_editor_bookmark_start_39" style="display: none; line-height: 0px;">‍</span><br>