问题:通过python 统计uid不同的,并且是"a=RUN"的次数

#!/usr/bin/python
# -*- coding:utf-8 -*-
##exapmle:统计‘a=RUN’的次数,并且UID不能重复
##123.234.40.34 - - [21/Apr/2014:11:22:51 +0800] "GET /aaa.php?uid=S-1-5-21-1629627082-3848928471-3880619898-500&a=OFFL&c=24120947886984&v=1.12.144 HTTP/1.1" 444 0 "-"
import os
import sys
import time
import re
###初始化
c1=0
d1={}
re1=r'uid=(.*?)&'
yesterday=time.strftime('%Y-%m-%d',time.localtime(time.time()-24*60*60))
###读取日志文件
fileHandle=open(sys.argv[1],'r+')
fileList=fileHandle.readlines()
###遍历每行内容
for fileLine in fileList:
###统计‘a=RUN’的次数,并且UID不能重复
    if fileLine.find('a=RUN') != -1:
###通过正则匹配,获取UID值,返回是list类型,利用字典处理uid重复问题
        uid = re.findall(re1, fileLine, re.S)
        if uid[0] in d1 :
            d1[uid[0]]+=1
        else:
            d1[uid[0]]=1
            c1+=1
              
print 'RUN = %d' % c1
          
          
fileHandle.close()
###将结果以追加方式写入文件
result=yesterday+' RUN= '+str(c1)+'\n'
anlyResult=open('anlyResultFile.txt','a')
anlyResult.write(result)
anlyResult.close()