Created
September 13, 2014 10:27
-
-
Save non117/1e10735d4c85b8a7f771 to your computer and use it in GitHub Desktop.
pathlibとshutilを使ってファイルのコピーとか
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
# -*- coding: utf-8 -*- | |
import shutil | |
from pathlib import Path | |
dst = Path('dst') | |
lis = open('prior-reedit-sorted.txt').readlines() | |
for filename in lis: | |
d,_,_, f = filename.strip().split('_') | |
path = Path(d) / Path('_'+f) | |
print(filename[:-1]) | |
shutil.copyfile(path.as_posix(), (dst / filename[:-1 ]).as_posix()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment