list from FTP server to a text file

Ahmed, Shakir shahmed at sfwmd.gov
Thu Jan 6 10:51:42 EST 2011


Hi,

I am trying to create a list in a txt file from an ftp server. The
following code is retrieving the list of the files but could not able to
write in a text file. Any help is highly appreciated.

Thanks


 
**************************** 
import os
import time
from ftplib import FTP
ftp = FTP("*.org","","")   # connect to host, default port
ftp.login()
ftp.cwd("/pub/remotefolder/")
ftp.retrlines('NLST')
******************************



More information about the Python-list mailing list