Python: Deleting files of a certain age
<p>So at the moment I'm trying to delete files listed in the directory that are 1 minute old, I will change that value once I have the script working.<br>
The code below returns the error: <code>AttributeError: 'str' object has no attribute 'mtime'</code></p>

<pre><code>import time
import os 
#from path import path

seven_days_ago = time.time() - 60
folder = '/home/rv/Desktop/test'

for somefile in os.listdir(folder):
    if int(somefile.mtime) &lt; seven_days_ago:
        somefile.remove()
</code></pre>
