title: How to get the most recent file
body: <p>i am newbie in Python language and i need write a code that list directory that contains
  files with random names, for example:</p>
  
  <blockquote>
    <p>JuniperAccessLog-standalone-FCL_VPN-20120319-1110.gz<br>
    JuniperAccessLog-standalone-FCL_VPN-20120321-1110.gz</p>
  </blockquote>
  
  <p>I need get the more recent file</p>
  
  <p>I try this, but without success.</p>
  
  <pre><code>import os
  from datetime import datetime 
  
  t = datetime.now()
  archive = t.strftime("JuniperAccessLog-standalone-FCL_VPN-%Y%m%d-%H*.gz")
  file = os.popen(archive)
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>sh: JuniperAccessLog-standalone-FCL_VPN-20120320-10*.gz: command not found
  </code></pre>
  
  <p>have a possibility the use this logic ?</p>