Re: [Tutor] FTP from mainframe

2010-07-29 Thread Alan Gauld
"Christian Witts" wrote When I'm retrieving items I use retrbinary for eg. The only issue with that is that if this is a real big-iron mainframe then ftp can translate EBCDIC to ASCII during the transfer whereas binary will, I think, bring the original file across untranslated. So you would

Re: [Tutor] FTP from mainframe

2010-07-29 Thread Christian Witts
On 29/07/2010 18:34, Steve Bricker wrote: This is my first attempt to FTP a file from a mainframe. The code: import ftplib session = ftplib.FTP('company.lan.com','userid','passwd') myfile = open('PC.filename','w') session.retrlines("RETR 'mainframe.filename'", myfile) myfile.close() session.qui

Re: [Tutor] FTP from mainframe

2010-07-29 Thread Bill Campbell
On Thu, Jul 29, 2010, bob gailer wrote: > > On 7/29/2010 12:34 PM, Steve Bricker wrote: > > This is my first attempt to FTP a file from a mainframe. The code: > import ftplib The easiest way I've found to get a file via ftp in python is to user urllib, not ftplib. Something like this (

Re: [Tutor] FTP from mainframe

2010-07-29 Thread Alan Gauld
"Steve Bricker" 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 n

Re: [Tutor] FTP from mainframe

2010-07-29 Thread bob gailer
On 7/29/2010 12:34 PM, Steve Bricker wrote: This is my first attempt to FTP a file from a mainframe. The code: import ftplib session = ftplib.FTP('company.lan.com','userid','passwd') myfile = open('PC.filename','w') session.retrlines("RETR 'mainframe.filename'", myfile) myfile.close() session.q

[Tutor] FTP from mainframe

2010-07-29 Thread Steve Bricker
BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }This is my first attempt to FTP a file from a mainframe. The code: import ftplib session = ftplib.FTP('company.lan.com','userid','passwd') myfile = open('PC.filename','w') session.retrlines("RETR 'mainframe.filename'", myfile) myf