[파이썬] 디렉터리마다 파일 n개씩만 다른 폴더로 복사하기
·
파이썬
import os import shutil import natsort as natsort NAME_PATH = os.path.join(os.getcwd() + '/training/') IMG_PATH = os.path.join(os.getcwd() + '/target/') PATH = os.getcwd() count = 0 one = os.listdir(IMG_PATH) one = natsort.natsorted(one) for i in one: two = natsort.natsorted(os.listdir(os.path.join(os.getcwd() + '/target/'+i+"/"))) for j in two: three = natsort.natsorted(os.listdir(os.path.join(..