2504회 수시2,3 채점자료 업데이트
This commit is contained in:
@@ -5,7 +5,7 @@ import unicodedata
|
||||
def copy_dic_subdirs(source_root, target_root_a, target_root_b, target_root_c, target_root_d, target_root_e):
|
||||
for root, dirs, files in os.walk(source_root):
|
||||
for dir_name in dirs:
|
||||
if dir_name == 'DIW': # DIC 디렉토리 탐색
|
||||
if dir_name.lower() == 'diw': # DIC 디렉토리 탐색
|
||||
parent_dir = os.path.basename(os.path.dirname(os.path.join(root, dir_name)))
|
||||
target_root = None
|
||||
parent_dir = unicodedata.normalize('NFC', parent_dir)
|
||||
@@ -24,7 +24,8 @@ def copy_dic_subdirs(source_root, target_root_a, target_root_b, target_root_c, t
|
||||
|
||||
if target_root:
|
||||
source_dic_path = os.path.join(root, dir_name)
|
||||
target_dic_path = os.path.join(target_root, dir_name)
|
||||
target_dir_name = dir_name.upper()
|
||||
target_dic_path = os.path.join(target_root, target_dir_name)
|
||||
|
||||
# DIC 하위 디렉토리와 파일 복사
|
||||
shutil.copytree(source_dic_path, target_dic_path, dirs_exist_ok=True)
|
||||
@@ -34,11 +35,15 @@ def copy_dic_subdirs(source_root, target_root_a, target_root_b, target_root_c, t
|
||||
print(f"Skipping {dir_name} under {parent_dir}, as it doesn't match '2교시' or '3교시'.")
|
||||
|
||||
# 사용법
|
||||
source_directory = r"C:\Users\dra\project\data\제2503회 정기\답안파일\제2503회 디지털정보활용능력 정기검정 답안파일" # 원본 디렉토리 경로
|
||||
target_directory_a = r".\input\A" # '1교시'의 타겟 경로
|
||||
target_directory_b = r".\input\B" # '2교시'의 타겟 경로
|
||||
target_directory_c = r".\input\C" # '3교시'의 타겟 경로
|
||||
target_directory_d = r".\input\D" # '4교시'의 타겟 경로
|
||||
target_directory_e = r".\input\E" # '5교시'의 타겟 경로
|
||||
# exam_round = "2504_2"
|
||||
exam_round = "2504_3"
|
||||
# source_directory = r"C:\Users\dra\project\data\제2504회 수시2(제주)\답안파일" # 원본 디렉토리 경로
|
||||
source_directory = r"C:\Users\dra\project\data\제2504회 수시3(읍내)\답안파일" # 원본 디렉토리3경로
|
||||
|
||||
target_directory_a = f".\\input\\{exam_round}\\A" # '1교시'의 타겟 경로
|
||||
target_directory_b = f".\\input\\{exam_round}\\B" # '2교시'의 타겟 경로
|
||||
target_directory_c = f".\\input\\{exam_round}\\C" # '3교시'의 타겟 경로
|
||||
target_directory_d = f".\\input\\{exam_round}\\D" # '4교시'의 타겟 경로
|
||||
target_directory_e = f".\\input\\{exam_round}\\E" # '5교시'의 타겟 경로
|
||||
|
||||
copy_dic_subdirs(source_directory, target_directory_a, target_directory_b, target_directory_c, target_directory_d, target_directory_e)
|
||||
|
||||
Reference in New Issue
Block a user