I
IamIan
Hello all,
I'm trying to use a regular expression in an FTP script to list
certain files. When run in a standard FTP session the command:
dir ????????.??[oOdDnNmM]*
returns 48 files. When I use the following Python script it prints
roughly 12 files (a subset of the 48), ending with 'None':
import ftplib, traceback
ftp = ftplib.FTP('host')
ftp.login(user='user', passwd='pass')
try:
admFiles = ftp.dir('????????.??[oOdDnNmM]*')
print admFiles
except:
traceback.print_exc
ftp.quit()
Is my Python syntax off?
Thank you.
I'm trying to use a regular expression in an FTP script to list
certain files. When run in a standard FTP session the command:
dir ????????.??[oOdDnNmM]*
returns 48 files. When I use the following Python script it prints
roughly 12 files (a subset of the 48), ending with 'None':
import ftplib, traceback
ftp = ftplib.FTP('host')
ftp.login(user='user', passwd='pass')
try:
admFiles = ftp.dir('????????.??[oOdDnNmM]*')
print admFiles
except:
traceback.print_exc
ftp.quit()
Is my Python syntax off?
Thank you.