本人原创,转载请注明出处,合法转载
文章出处:http://blog.csdn.net/yanshu2012
#!/bin/env python
# coding=UTF-8
import socket
import sys
import redis
from multiprocessing import Pool
import time
redis_host="127.0.0.1"
redis_port=6379
all_key="all"
right_key="right"
g_progress_num=150
def check_domain(domain):
try:
host=domain.split("\n")[0]
#print host
results=socket.getaddrinfo(host,80, 0, 0, socket.IPPROTO_TCP)
#print results
#print results[0][4]
return True
except Exception as e:
#print "[ERROR]%s" % (e)
#print "[ERROR]%s" % (line)
return False
def work_progress():
try:
cli=redis.StrictRedis(redis_host,redis_port,db=0)
exit_count=0
while