Finding and copying files with python.
oliver at obeattie.com
oliver at obeattie.com
Tue Apr 3 09:28:39 EDT 2007
Just sort them and then select the bottom one from a list by using a
negative indices. I.e.:
list[-1]
Would return the bottom result out of a list
On Apr 3, 2:21 pm, "gtb" <goodTweetieB... at hotmail.com> 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
>
> filename_MM.NN.SS.zip, where MM, NN, and SS can be one to three
> digits.
>
> Example directory:
> other.zip
> dx_ver_1.1.63.zip
> dx_ver_1.2.01.zip
> dx_ver_1.12.7.zip
> 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
More information about the Python-list
mailing list