Created
January 13, 2021 02:47
-
-
Save dharma6872/0b3710638387a139b5049e8ac83a1cce to your computer and use it in GitHub Desktop.
폴더복사
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
copyfile과 copy는 메타정보는 복사되지 않습니다. | |
copy2는 메타정보도 복사합니다. | |
copy2를 사용하면 파일을 작성한 날짜도 복사되지만 | |
copyfile과 copy는 파일을 작성한 날짜가 복사한 날짜로 변경됩니다. | |
""" | |
import os | |
import shutil # 셸 유틸리티 | |
# 디렉터리 복사하기 | |
def copytree(src, dst, symlinks=False, ignore=None): | |
for item in os.listdir(src): | |
s = os.path.join(src, item) | |
d = os.path.join(dst, item) | |
if os.path.isdir(s): | |
shutil.copytree(s, d, symlinks, ignore) | |
else: | |
shutil.copy2(s, d) | |
copytree("bert/multi_cased_L-12_H-768_A-12", "bert") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment