B
Bob
I am trying to get the latest file from an ftp site that matches a
pattern and is the latest one. I have it in Perl and would like to see
the Python version for comparison.
Perl version:
# this matches the name only by looking at files
# that start with 8 numbers (i.e. 20021203)
foreach(@list) {
if(m/\d{8}.*x86.exe/) {
push(@match,$_)
}
}
if(scalar(@match)) {
my $file=$match[$#match];
$ftp->binary();
$ftp->get($file);
}
$ftp->quit;
pattern and is the latest one. I have it in Perl and would like to see
the Python version for comparison.
Perl version:
# this matches the name only by looking at files
# that start with 8 numbers (i.e. 20021203)
foreach(@list) {
if(m/\d{8}.*x86.exe/) {
push(@match,$_)
}
}
if(scalar(@match)) {
my $file=$match[$#match];
$ftp->binary();
$ftp->get($file);
}
$ftp->quit;