How exactly would you create a list of the entries in an FTP directory?
This is my code so far:
import ftplib
files = []
my_ftp = ftplib.FTP(HOST)
my_ftp.login(USERNAME,PASSWORD)
line = my_ftp.retrlines("NLST",files.append(line))
my_ftp.quit()
The error says that the variable line is being used before it is defined.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…