def change_file_ext():
    """ read a file and an extension from the command line and produces a copy with its extension changed"""
    if len(sys.argv) < 2:
        print("Usage: change_ext.py filename.old_ext 'new_ext'")
        sys.exit()

    name = os.path.splitext(sys.argv[1])[0] + "." + sys.argv[2]
    print (name)

    try:
        shutil.copyfile(sys.argv[1], name)
    except __HOLE__ as err:
        print (err)
dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/src/USEFUL/useful_with_files/change_ext_file.py/change_file_ext