#!/bin/usr/python import os import sys import subprocess filenum = open(‘/python/photolist‘,‘r+‘) list1 = [] photofile = [] for line in filenum.readlines(): line = line.strip(‘\n‘) list1.append(line) filenum.close() for filenames in os.walk(‘/photo/photo‘): photofile.extend(filenames[2]) count = 0 for ele in photofile: if ele[4:8] in list1: str = ‘/photo/photo/‘ + ele print str count += 1 subprocess.call([‘cp‘,str,‘/photo1‘]) else: pass print count ~
时间: 2024-10-13 13:12:34