FTP (ftplib) output capture

ChaosKCW da.martian at gmail.com
Mon Jul 31 11:53:09 EDT 2006


Hi

Has anyone caputerd the output from the std ftp lib? It seems a bit
annoying that everything is printed to stdout. It means incorporating
this into any real program is a problem. It would have been much better
if they used the std logging module and hooked up a console logger for
the feault ftp application. Alas it isnt that way.

Capturing stdout like this??? :

import sys

sys.stdout = open('bb', 'w)

But I want to re-route it to the logging module not a file , so do I
need to write a steam object? 

Thanks,




More information about the Python-list mailing list