Creating a list from a relay in Python
How exactly will you create a list of entries in the FTP directory?
This is my code:
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 string is used before it is defined.
+3
source to share