This simple code:
import ftplib
ftp = ftplib.FTP("ladsweb.nascom.nasa.gov")
ftp.login()
ftp.cwd("allData/5/MOD11A1/2012/193/")
a = ftp.retrlines('NLST')
Logs into an ftp, changes the current directory, and lists the names of the files contained within the current directory.
If I afterwards check what variable a
contains inside, I get this:
>>> print (a)
226 Listing completed.
So, I don't understand where the list of the file names is stored. Any idea? I want to apply some regular expression operations to the file names later on.