def main():
global eu
eu = 0
total=len(open('10000.txt','rU').readlines())
print 'Total URLs:%d' %total
for i in open("10000.txt").readlines():
i=i.strip('\n')
t=threading.Thread(target=check, args=(i,total))
t.setDaemon(True)
total-=1
while True:
if(threading.active_count() == 1 and total == 0 ):
print 'All Done at %s' %time.strftime("%Y-%m-%d[%H.%M.%S]")
break
elif (threading.active_count() < 200):
if (total == 0):
time.sleep(10)
else:
os.system("title Spider,Current threads: %d,URLs left: %d,URLs exists:%d" %(threading.active_count(),total,eu))
t.start()
break
评论列表
文章目录