"eels" <[EMAIL PROTECTED]> writes: > With yyy = ftp.retrlines('LIST') I get this listing at stdout, but I > need this information at variable yyy. > How can I resolve this problem?
As written in the doc retrlines has an optional parameter (a callback function) called on each line retrieved, so you can do something like this: from ftplib import FTP def writeline(data): fd.write(data + "\n") f = FTP('ftp.kernel.org') f.login() f.cwd('/pub/linux/kernel') fd = open('README', 'wt') f.retrlines('RETR README', writeline) fd.close() f.quit() -- Lawrence - http://www.oluyede.org/blog "Anyone can freely use whatever he wants but the light at the end of the tunnel for most of his problems is Python" -- http://mail.python.org/mailman/listinfo/python-list