title: Python program to rename file names while overwriting if there already is that file
body: <p>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.</p>
  
  <pre><code>import os, sys
  
  original = sys.argv[1]
  output = sys.argv[2]
  
  os.rename(original, output)
  </code></pre>
  
  <p>But my code just shows me this error when there already is file with that destination name.</p>
  
  <pre><code>  os.rename&lt;original, output&gt;
  WindowsError: [Error 183] Cannot create a file when that file already exists
  </code></pre>
  
  <p>What fix should I make?</p>