FTP module file parsing..

Wayne Ringling wayne at tbnets.com
Thu Dec 5 11:24:41 EST 2002


 I want to parse a file as I down load it from a server. So I do the following.


from ftplib import FTP
ftpserver = FTP('server', 'user', 'passwd')
ftpserver.cwd('/where the file is')
datalist = ftpserver.retrlines('RETR filename')
ftpserver.quit()

this dumps the whole file into the datalist.  I would like to only parse the file line by line and not load the whole thing into the list and also not download it to the machine and then parse it.  Am I crazy for thinking this way or am I missing something?

Wayne






More information about the Python-list mailing list