Python: How to get list of file and use wildcard in FTP directory?

后端 未结 1 1558
Happy的楠姐
Happy的楠姐 2021-01-27 12:45

I\'m new to python. I want to access baseURL and eventually get a list of files in one of the sub-directories so I can download/unzip this file. The specific file extension can

1条回答
  •  迷失自我
    2021-01-27 13:24

    You could use Python ftplib, https://docs.python.org/3/library/ftplib.html, as a ftp client. I don't think wildcard downloads are support, so you'd have to do something along the lines of...

    1. Login to the FTP server
    2. Navigate to the desired directory
    3. Get a listing of the files, iterate thorough the files and match according to the desired file format
    4. Download desired files

    0 讨论(0)
提交回复
热议问题