#!/usr/bin/python
#-*- coding: UTF-8 -*-
from collections import Counter
ips = []
c = Counter()
with open('www_access.log') as f:
for line in f:
ips.append(line.split()[0])
c[line.split()[6]] += 1
print("PV is {0}".format(len(ips)))
print("UV is {0}".format(len(set(ips))))
print("Popular resources : {0}".format(c.most_common(10)))
「 文章如果对你有帮助,请点个赞哦^^ 」 
2+
若无特殊注明,文章均为本站原创或整理发布。
转载请注明本文地址:https://om.fangxiaoxiong.com/3151.html