output = sys.argv[2]
try:
    os.rename(original, output)
except WindowsError:
    os.remove(output)
os.rename(original, output)
Python program to rename file names while overwriting if there already is that file