Sort files by date

2005-07-12 Thread fargo
Hi. I'm looking for some way to sort files by date. I'm usin glob module to list a directiry, but files are sorted by name. >>> import glob >>> path = "./" >>> for ScannedFile in glob.glob(path): ... print ScannedFile I googled my problem, but did not find any solution, neither in this

Re: Sort files by date

2005-07-12 Thread fargo
Jeremy Sanders wrote: > you could do something like: > > l = [(os.stat(i).st_mtime, i) for i in glob.glob('*')] > l.sort() > files = [i[1] for i in l] Thank you for your help, this is excatly what I wasa looking for. -- http://mail.python.org/mailman/listinfo/python-list

MD5 problem

2005-06-13 Thread fargo
Hi. I'm in trouble with the md5 module. Under Linux, it's ok, I get real signatures. The problem is under Windows XP, with some kind of files. If I use the md5 module with .txt files, it'ok. The Problem comes from the .msg files. I get the same signature for every .msg file I try to hash with

Re: MD5 problem

2005-06-13 Thread fargo
Roel Schroeven wrote: > fargo wrote: > >> Hi. >> >> I'm in trouble with the md5 module. >> >> Under Linux, it's ok, I get real signatures. >> >> The problem is under Windows XP, with some kind of files. >> >> If I use the md

Re: string formatting using the % operator

2005-06-13 Thread fargo
William Gill wrote: > I am using the % operator to create queries for a db app. It works fine > when exact strings, or numbers are used, but some queries need partial > matching that use the '%' as a wildcards. So for example the resultant > string should be 'WHERE name LIKE %smith%' (would ma