title: How to rename and relocate the most recently downloaded file via python?
body: <p>I'm just wondering how I can write a code that locates the most recently downloaded file - without me knowing the name of said file - and renames and relocates it to a specified directory via Python</p>
  <pre><code>list_of_files = glob.glob(&quot;C:\\Users\\shashem\\Downloads\\*&quot;)
  latest_file = max(list_of_files, key=os.path.getctime)
  mypath = &quot;C:\\Users\\shashem\\Desktop&quot;
  old_name = max(list_of_files, key=os.path.getctime)
  new_name = input(&quot;Testnew&quot;)
  new_path = &quot;C:\\Users\\shashem\\Desktop&quot;
  os.rename()'
  </code></pre>
  <p>This is where I am, obviously not finished, but I'm a bit lost and would appreciate any proposed solutions.</p>