python 线程

#百度线程
def baiduss(urls):
    for web in urls:
        if web:
            #百度site
            webToF = baiduwebJudge(web)
            #判断去留 T 为留 F为扔
            if webToF == "T":
                print("保留")
                saveUrl.append(web)

threads = []
t1 = Thread(target=baiduss,args=(urls1,))#传入的参数数据args一定要是(参数,)的形式   很坑啊!!!!!!
t2 = Thread(target=baiduss,args=(urls2,))
threads.append(t1)
threads.append(t2)

for t in threads:
    t.setDaemon(True)
    t.start()
t.join()# 待子线程结束,主线程结束

 

posted @ 2018-05-02 15:25  自说自话唉  阅读(165)  评论(0编辑  收藏  举报