#coding=utf-8
import os
import  shutil
stra = "G:/should/v3/a"
strb = "G:/should/v3/b"



fobj = open('D:/V3/bt/c.bt','rb')
line = fobj.readline()
while line:
    #print(line)
    if(line.find('a') > 0):
        line = line.strip('\r\n')
        strsha1 = line.split('\\')
        strsha1 = strsha1[-1]
        if(os.path.exists(line)):
            shutil.move(line, stra+'/'+strsha1)
    elif(line.find('b') > 0):
        line = line.strip('\r\n')
        strmd5 = line.split('\\')
        strmd5 = strmd5[-1]
        if(os.path.exists(line)):
            shutil.move(line, strb+'/'+strmd5)
    else:
        print(line)

    line = fobj.readline()

fobj.close()

  

posted on 2014-06-23 17:03  小白闯天下  阅读(256)  评论(0编辑  收藏  举报