-1

I have the following:

filelist=[]
aec.retrlines('NLST', filelist.append)

As well as doing what I want it to do, which is create a list of files from an FTP folder called "filelist", this also prints that list of files to the console. But I don't want an endless list of file names cluttering up my console. How do I stop it from doing this?

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153
  • 1
    What version of Python are you using? I don't see a list of file names being printed out when using Python 3.7.9. – D Malan May 28 '22 at 11:38

1 Answers1

0

Check if you set the debug level to be higher than 2 (set_debuglevel) it will print file names to your console, it's a feature:

if self.debugging > 2:
    print('*retr*', repr(line))
Ze'ev Ben-Tsvi
  • 1,174
  • 1
  • 3
  • 7