title: Rename and move file with Python
body: <p>I have a Python script that compares existing file names in a folder to a reference table and then determines if it needs to be renamed or not.</p>
  <p>As it loops through each filename:</p>
  <pre><code>'oldname' = the current file name
  
  'newname' = what it needs to be renamed to
  </code></pre>
  <p>I want rename the file and move it to a new folder &quot;..\renamedfiles&quot;</p>
  <p>Can I do the rename and the move at the same time as it iterates through the loop?</p>