1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/python
# -*- coding: GBK -*-
#---------------------------------------------------------------------
#Writer £ºMark
#×Ô¶¯ÐÞ¸ÄÎļþGeneralProgramme.txtÖеÄMD5
#---------------------------------------------------------------------
#½Å±¾ËµÃ÷
#---------------------------------------------------------------------
#µ¼Èë
import os
import md5
#---------------------------------------------------------------------
#È«¾Ö±äÁ¿
#---------------------------------------------------------------------
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
 
os_path = os.getcwd()
 
checkFilePath = os.getcwd() + '\\GeneralProgramme.txt'
 
checkFile = open( checkFilePath , 'r')
 
date = [ line.split('\t') for line in checkFile.readlines() ]
 
checkFile.close()
 
writelist = []
 
for i in range(0 , len(date)):
    dateList = date[i]
    if not i:
        #µÚÒ»ÐÐ
        writelist.append( dateList )
        continue
    
    dateName = dateList[0]
    datePath = dateList[1]
    dateMD5 = dateList[2]
    dateMsg = dateList[3]
    
    curFile = open(  os_path + '%s.txt'%datePath ,'rb')
    
    curFilemd5 = md5.md5(curFile.read()).hexdigest()
    
    curFile.close()
    
    writelist.append( [ dateName , datePath , curFilemd5 , dateMsg ])
    
checkFile = open( checkFilePath , 'w')
 
for line in writelist:
    for msgCount in range(len(line)):
        msg = line[msgCount]
        checkFile.write(msg)
        if msgCount != len(line) - 1:
            checkFile.write('\t')
 
checkFile.close()
 
os.system('pause')