- 论坛徽章:
- 0
|
直接上代码....最近在公司比较闲。。。。- list = ['2011/08/22 /Uid_5622/app_0/page=Login/p1=/p2=', '2011/08/22 /Uid_5622/app_0/page=Login/p1=/p2=', '2011/08/22 /Uid_5622/app_0/page=GameIndex/p1=/p2=', '2011/08/22 /Uid_3855/app_0/page=Login/p1=/p2=', '2011/08/22 /Uid_3855/app_0/page=GameIndex/p1=/p2=', '2011/08/22 /Uid_5622/app_0/page=GameIndex/p1=/p2=', '2011/08/22 /Uid_5622/app_0/page=GameIndex/p1=/p2=', '2011/08/22 /Uid_4932/app_-1/page=MallIndexLog/p1=/p2=', '2011/08/22 /Uid_4932/app_0/page=MallIndex/p1=1/p2=213', '2011/08/22 /Uid_5931/app_0/page=Login/p1=/p2=', '2011/08/22 /Uid_5622/app_0/page=Login/p1=/p2=', '2011/08/22 /Uid_4932/app_-1/page=MallIndexLog/p1=/p2=', '2011/08/22 /Uid_4932/app_0/page=MallIndex/p1=1/p2=213', '2011/08/22 /Uid_5051/app_0/page=Login/p1=/p2=', '2011/08/22 /Uid_5051/app_0/page=Login/p1=/p2=', '2011/08/22 /Uid_5051/app_0/page=Login/p1=/p2=', '2011/08/22 /Uid_5051/app_0/page=Sms/p1=/p2=', '2011/08/22 /Uid_5051/app_0/page=Sms/p1=/p2=', '2011/08/22 /Uid_5051/app_0/page=GameIndex/p1=/p2=']
- dict = {}
- for i in list:
- if dict.has_key(i.split(" ")[1]):
- dict[i.split(" ")[1]] += 1
- else:
- dict[i.split(" ")[1]] = 1
- for k, v in dict.items():
- print k,v
复制代码 |
|