获取top10

ips = ['', '123.125.71.49', '164.132.161.48', '217.182.132.55', '217.182.132.55', '217.182.132.94', '220.181.108.162', 
'51.255.65.47', '51.255.65.6', '51.255.65.77', '51.255.65.96'] r = Counter(ips) zip(r.values(),r.keys()) fr = r.most_common()#这里可以指定个数 for line in fr: if line: if line[0]: print('ip个数:',line[1],' ip:',line[0])

 

posted @ 2017-04-21 11:14  明天OoO你好  阅读(265)  评论(0编辑  收藏  举报