【Python学习】Thread笔记(1)

Python学习笔记 - Thread(1)

标签(空格分隔): python



from threading import Thread

num = 2000
id_list = []

def do_work(id):
    id_list.append(id)

lat = 27.001
lng = 80.002
loc_list = []
threads = []
for i in range(num):
    t = Thread(target=do_work, args=(i,))
    threads.append(t)
    t.daemon = True
    t.start()

for x in threads:
    x.join()

print("Done!")
print id_list

posted on 2016-07-27 14:26  Jenny_HUI  阅读(174)  评论(0编辑  收藏  举报

导航