# -*- coding: utf8 -*- import os import shutil import sys path = '/Users/***/Desktop/test/src/' files = os.listdir(path) new_path = '/Users/***/Desktop/test/dir/' if not os.path.exists(new_path): os.mkdir(new_path) for file in files: shutil.move(path + file, new_path + file) # -*- coding: utf8 -*- : 한글사용을 위한 인코딩 Python3은 필요없음
반응형
shutil
반응형