python saving output from a for iteration and subprocess for checksum
问题 The purpose of this script is to pull md5 checksum from each file of a directory as source and then (I'm working on that also) execute the script on the destination so validate it has copied correctly. #!/usr/bin/env python import os from sys import * import subprocess script, path = argv destination = "./new_directorio/" archivo = "cksum.txt" def checa_sum(x): ck = "md5 %s" % x p = subprocess.Popen(ck, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() out = open(archivo,'w'