#coding=utf-8 import os import httplib import socket dictlist ={}; def ReadHost(): hosts = []; obn = open('d:/sss.txt', 'rb'); for line in obn: #sometime you should filter \r\n line = line.strip('\n') hosts.append(line) obn.close(); return hosts; def…