How do I parse a listing of files to get just the filenames in Python?

前端 未结 7 1524
一向
一向 2021-02-10 23:50

So lets say I\'m using Python\'s ftplib to retrieve a list of log files from an FTP server. How would I parse that list of files to get just the file names (the last column) ins

7条回答
  •  说谎
    说谎 (楼主)
    2021-02-11 00:23

    Is there any reason why ftplib.FTP.nlst() won't work for you? I just checked and it returns only names of the files in a given directory.

提交回复
热议问题