0
イム私のFTPサーバ内のファイルは
PythonのFTP filematchにのみ最後のファイルベースの取得
testing_01.xml
testing_02.xml
testing_03.xml(これですある最新のファイル)
from ftplib import FTP
ftp = FTP('FTP IP') # open FTP connection to MSM
ftp.login(user = 'username',passwd = 'password')
ftp.dir()
directory ="/temp/" #directory where file should downloaded
filematch = 'testing_*.xml' # a file match to be downloaded
ftp.cwd(directory)
for filename in ftp.nlst(filematch): # Loop - looking for matching files
fhandle = open(filename, 'wb')
ftp.retrbinary('RETR ' + filename, fhandle.write)
fhandle.close()
スクリプト上記のftpからすべてのファイルを取得します
私の目的は最新のファイル "testing_03.xml"を取得することです。
それが今 – user3584454
作業だが、どうもありがとうございました(のhttp://メタ.stackexchange.com/a/5235/193893)&[誰かが私の質問に答えるとどうすればいいですか?](http://stackoverflow.com/help/someone-answers) – aneroid