John Machin wrote: > snowf wrote: > > There are no such a method using to download a whole directory in the > > lib of ' ftplib '. > > thanks for anybody's help! > > So you'll have to lash one up: > > (untested) > > Firstly, > alist = [] > ftpobj.retrlines('list', alist.append) > should get you a list of filenames. > > Secondly, > > for fname in alist: > f = open(fname, "wb") > ftpobj.retrbinary('RETR ' + fname, f.write) > f.close() > > should do the business. Instead of using f.write as the callback, you > might like to wrap that in a function that counts the bytes received, > displays progress, etc. > > HTH, > John Thanks for you reply! I will have a try with your suggest and show the result later.
-- http://mail.python.org/mailman/listinfo/python-list