Created
June 30, 2020 16:04
-
-
Save atsushi-kitazawa/d292abfdfb8647d063ca458a86c4268e to your computer and use it in GitHub Desktop.
copy file script.
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 sys | |
import shutil | |
import os | |
def copy(file_list, copy_dir): | |
if not os.path.isfile(file_list): | |
print(file_list + ' not found.') | |
return | |
with open(file_list) as f: | |
files = [ line.strip() for line in f.readlines() ] | |
for f in files: | |
shutil.copy(f, copy_dir) | |
if __name__ == '__main__': | |
print('main') | |
copy('input.txt', 'copy_to') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment