수입 운영 체제의
또 shutil 수입
ADIR = './trainA0/'
Bdir = './trainB0/'
alldir = './all/'
하지 않을 경우 os.path.exists (ADIR) :
인쇄 ( "원본 경로 trainA0가 존재하지 않습니다" )
하지 않을 경우 os.path.exists (Bdir) :
인쇄 ( "원본 경로 trainB0가 존재하지 않습니다")
하지 않을 경우 os.path.exists (alldir) :
os.mkdir (alldir)
0 = NUM
os.listdir에서 인터넷 (ADIR) 대 :
im_name = '0'+ 인터넷 [1.]
shutil.copyfile (ADIR + Fi 접속 alldir + STR (NUM) + '_'+ FI) 폴더 # ADIR 인터넷 파일은 폴더로 복사 alldir 이름 바꾸기 STR (NUM) + '_'+ 인터넷
shutil.copyfile (Bdir +의 im_name, alldir + STR (NUM) + '_'+ im_name)
NUM = NUM . 1 +
인쇄 (NUM)