class Writer: def __init__(self, file): self.f = open(file, "w") def __call__(self, data): self.f.write(data) self.f.write('n') print dataFILENAME = "AutoIndent.py"writer = Writer(FILENAME)import ftplibftp = ftplib.FTP('127.0.0.1', 'book', 'bookpw')ftp.retrlines("RETR %s" % FILENAME, writer)
Name (required)
email (will not be published) (required)
Website