Skip to content

Instantly share code, notes, and snippets.

@rajasimon
Created April 26, 2018 15:06
Show Gist options
  • Save rajasimon/5f2b6a1795b024539c7ae1bcdc099a79 to your computer and use it in GitHub Desktop.
Save rajasimon/5f2b6a1795b024539c7ae1bcdc099a79 to your computer and use it in GitHub Desktop.
"""
Copy file Operation
"""
import os
import shutil
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--name', required=True)
parser.add_argument('--file1', required=True)
parser.add_argument('--file2', required=True)
# Parse argument
args = parser.parse_args()
# Create folder
try:
os.mkdir(args.name)
except:
pass
# File copy operation
shutil.copy(args.file1, args.name)
shutil.copy(args.file2, args.name)
@rajasimon
Copy link
Author

Copy File Operation

Usuage

python app.py --name <folder_name> --file1 <file1_full_path> -- file2 <file2_full_path>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment