[Tutor] globbing and sorting and dating, oh my! (fwd)
Danny Yoo
dyoo at hkn.eecs.berkeley.edu
Mon Feb 23 14:00:35 EST 2004
Hi everyone,
Followup on Kirk's question: looks like he solved it. *grin*
---------- Forwarded message ----------
Date: Sun, 22 Feb 2004 23:47:41 -0500
From: Kirk Bailey <idiot1 at netzero.net>
To: Danny Yoo <dyoo at hkn.eecs.berkeley.edu>
Subject: Re: [Tutor] globbing and sorting and dating, oh my!
I already solved it, and tripped across a function in time and another in
os which did the work nicely. The technique of ADD A WEEK TO IT AND TOSS
ANYTHING LARGER THAN 'NOW' IN THE BIT BUCKET did the trick. For an
examination of the resulting script, try this link out:
http://www.tinylist.org/whatsnew.txt
Once I figured out time.time, it was easy. woaking through a list of all
files in that dir (only pages for the wiki were there, simplifying my task
immensely, a bit of luck I had the forsight to invent for myself at the
beginning), I had the script:
1. read the age for each
2. toss out those too old
3. appending the acceptable ones to a new list
4. printing them in links to the reader program
Then it closes the page printing out the page footer. 2 do loops. 2 lists.
More information about the Tutor
mailing list