import os import shutil path = 'D:\超级记录片\JavaSE第三季\' des = 'D:\超级记录片\JavaSE第三季\keke\' d = os.listdir(path) for i in d: if i!='keke': nw = path+i+'\' sw = os.listdir(nw) for j in sw: jian = nw+j if os.path.isfile(jian): #print des+j shutil.move(jian,des+j) print j+' '+'finished.'