Last active
August 8, 2017 02:51
-
-
Save naoki-sawada/05b0a446012b31def2e16a73a8334cfb to your computer and use it in GitHub Desktop.
replace the file name.
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
import os | |
from shutil import copyfile | |
from pathlib import Path | |
SOURCE_PATH = '.' | |
DEST_PATH = './re' | |
d_path = Path(DEST_PATH) | |
if not d_path.is_dir(): | |
os.makedirs(DEST_PATH) | |
files = os.listdir(SOURCE_PATH) | |
for file in files: | |
print(file) | |
copyfile(SOURCE_PATH+'/'+file, DEST_PATH+'/'+file.replace('-','_')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment