"cats" vs "dogs"

import os
import shutil
train_filenames=os.listdir("tran")
train_cat=filter(lambda x:x[:3]=="cat",train_filenames)
train_dog=filter(lambda x:x[:3]=="dog",train_filenames)

def rarf_mkdir(dirname):
    if os.path.exists(dirname):
        shutil.retree(dirname)
    os.mkdir(dirname)

你可能感兴趣的:("cats" vs "dogs")