Last active
September 6, 2020 13:14
-
-
Save Aebian/d5cc93d054b703102bfa16cd90951406 to your computer and use it in GitHub Desktop.
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 argparse | |
import shutil | |
import os | |
import sys | |
def create_arg_parser(): | |
parser = argparse.ArgumentParser(description='Copies a file a given time and renames it') | |
parser.add_argument('-s', dest="source_file", | |
help='The source file that should be copied') | |
parser.add_argument('-l', dest="outfile_names", nargs='+', type=str, help='Pass a list of names that will be used for renaming. Need to match with') | |
return parser | |
if __name__ == "__main__": | |
arg_parser = create_arg_parser() | |
args = arg_parser.parse_args() | |
source_file = args.source_file | |
outfile_names = args.outfile_names | |
for filename in outfile_names: | |
shutil.copyfile(source_file, os.path.dirname(source_file) + "/" + filename) | |
# © 2008 - 2018 by Aebian |
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
python3.5 copy_and_rename_file.py -s "/mnt/e/Games/Mods/GTAMODS_Drive/@DLC/natioh/dlc.rpf/x64/data/lang/americandlc.rpf" -l chinesedlc.rpf frenchdlc.rpf germandlc.rpf italiandlc.rpf japanesedlc.rpf koreandlc.rpf mexicandlc.rpf polishdlc.rpf portuguesedlc.rpf russiandlc.rpf spanishdlc.rpf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment