<span class="Apple-style-span" style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 22px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">For deleting mails by time stamp in a directory. cd into directory.</span><div>
<font class="Apple-style-span" face="verdana, Arial, Helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; line-height: 22px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;">python</span></font></div>
<div><font class="Apple-style-span" face="verdana, Arial, Helvetica, sans-serif"><span class="Apple-style-span" style="font-size: 12px; line-height: 22px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;">>>><br>
</span></font><div><span class="Apple-style-span" style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 22px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br>
</span></div><div><span class="Apple-style-span" style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 22px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br>
</span></div><div><span class="Apple-style-span" style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 22px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">import os, time<br>
<br>path = r"c:\tmp"<br>now = time.time()<br>for f in os.listdir(path):<br>if os.stat(f).st_mtime < now - 2 * 86400:<br>if os.path.isfile(f):<br>os.remove(os.path.join(path, f))<br></span></div></div>