Python Script to search by Date

Albert Hopkins marduk at letterboxes.org
Wed Nov 26 01:40:07 CET 2008


On Tue, 2008-11-25 at 16:10 -0800, gamersunit at gmail.com wrote:
> What I'm trying to do is decompress a bunch of files depending on the
> date/time specified.
> 
> So, we have full backups created every Sunday and transaction backups
> every hour afterwards.
> 
> I have everything compressed at an hourly basis.
> 
> Now, what I'm trying to create is a way to specify a date and time
> where it would automatically decompress the files.
> 
> The main part that I'm trying to figure out is how would I search the
> date and time, and it would the files from the sunday prior, to the
> specified date?
> 
> Anyone have an idea?
> --

Use os.path.getmtime(filename) to get the modification time of a file
(see the documentation).

-a







More information about the Python-list mailing list