title: Find file in directory with the highest number in the filename
body: <p>My question is closely related to <a href="https://stackoverflow.com/questions/27217928/python-identify-file-with-largest-number-as-part-of-filename">Python identify file with largest number as part of filename</a> </p>
  
  <p>I want to append files to a certain directory. The name of the files are: file1, file2......file^n. This works if i do it in one go, but when i want to add files again, and want to find the last file added (in this case the file with the highest number), it recognises 'file6' to be higher than 'file100'.</p>
  
  <p>How can i solve this.</p>
  
  <pre><code>import glob
  import os
  
  latest_file = max(sorted(list_of_files, key=os.path.getctime))
  print latest_file
  </code></pre>
  
  <p>As you can see i tried looking at created time and i also tried looking at modified time, but these can be the same so that doesn't help.</p>
  
  <p><strong>EDIT</strong> my filenames have the extention ".txt" after the number</p>