As the title says, I wanted a python program that changes the file name, but I wanted to overwrite if there already is a file with that destination name.
import os, sys
original = sys.argv[1]
output = sys.argv[2]
os.rename(original, output)
But my code just shows me this error when there already is file with that destination name.
os.rename<original, output>
WindowsError: [Error 183] Cannot create a file when that file already exists
What fix should I make?