Is it possible to force a rename os.rename to overwrite another file if it already exists? For example in the code below if the file Tests.csv already exists it would be replaced by the Tests.txt file (that was also renamed to Tests.csv).
os.rename("C:\Users\Test.txt","C:\Users\Tests.csv");
You could try
shutil.move():Or
os.removeand thenshutil.move: