摘要:
importsocket,threading,os,sys,queue,resocket.setdefaulttimeout(5)path=sys.path[0]ifos.path.isfile(path):path=os.path.split(path)[0]domain='www.baidu.com'que=queue.Queue()tno=20a=open(path+r'\proxy.txt').read().strip().split()foriina:que.put(i.split(':'))data='''GE 阅读全文
摘要:
python主代码weather.pyimporturllib2importjsonfromcityimportcitycityname=raw_input('你想查哪个城市的天气?\n')citycode=city.get(cityname)ifcitycode:url='http://www.weather.com.cn/data/cityinfo/%s.html'%citycodecontent=urllib2.urlopen(url).read()data=json.loads(content)result=data['weatherinfo 阅读全文