[python-win32] capturing stdout output from ftplib

David Rock David Rock <david@rock.homelinux.com>
Thu, 13 Jun 2002 00:48:45 -0500


On Thu, Jun 13, 2002 at 03:01:00PM +1000, Andrew Bennetts wrote:
> >From the ftplib documentation:
> """The callback function is called for each line, with the trailing CRLF
> stripped ..."""
> 
> So,
> 
>     fileList = []
>     ftp.retrlines('LIST', fileList.append)
> 
> That should call fileList.append for each line returned by the LIST
> command, resulting in the list you're interested in.  You should be able
> to do that ftp.dir, too.

That was it exactly, thanks!

-- 
David Rock
david@rock.homelinux.com