Finding and copying files with python.

kyosohma at kyosohma at
Tue Apr 3 15:31:47 CEST 2007

On Apr 3, 8:21 am, "gtb" <goodTweetieB... at> wrote:
> I wish to copy   the highest version number of a file from directory \
> \
> \fileserver\D:\scripts to C:\scripts where the file names are of the
> form
>, where MM, NN, and SS can be one to three
> digits.
> Example directory:
> temp.txt
> Does python have string matching routines  that would find the bottom
> listed zip file and/or file copying routines?
> A little pointer or two would be much appreciated.
> Thanks,
> jh

You could just use string slicing to cut off the first 7 characters
and have the numbers available to compare. There's also the os.stat
module to find the last modified date of the file. You might be able
to use the glob module to grab a list of the files and then sort the
list too.


More information about the Python-list mailing list