Skip to content

Instantly share code, notes, and snippets.

@atsushi-kitazawa
Created June 30, 2020 16:04
Show Gist options
  • Save atsushi-kitazawa/d292abfdfb8647d063ca458a86c4268e to your computer and use it in GitHub Desktop.
Save atsushi-kitazawa/d292abfdfb8647d063ca458a86c4268e to your computer and use it in GitHub Desktop.
copy file script.
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