[Tutor] FTP from mainframe

Alan Gauld alan.gauld at btinternet.com
Thu Jul 29 19:35:00 CEST 2010


"Steve Bricker" <bricker.steve at imonmail.com> wrote 

> }This is my first attempt to FTP a file from a mainframe.  

Thats one more than me!

> The resulting error is:
>    session.retrlines("RETR 'mainframe.filename'", myfile)
>  File "c:python26libftplib.py", line 428, in retrlines
>    callback(line)
> TypeError: 'file' object is not callable


The error says that its expecting a callable and you are 
passing a file object. My guess is you need to create a 
function that writes to the file and pass that to ftp.
You could use myfile.write maybe - thats what the 
documentation does for a binary file...

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list