can you pls shed some light on what I am doing wrong here... I'm a Python newby... This connects and I can get a list of files in a FTP specific directory, but for the love of BigBang.. It isn't downloading any files. I need to download files starting with a specific Name string:
from ftplib import FTP_TLS
import fnmatch
import os
ftps = FTP_TLS('myftp_site.com')
ftps.login('userxx', 'pwxx')
ftps.prot_p()
ftps.cwd('Inbox')
print("File list:")
list_of_files = ftps.retrlines("LIST")
dest_dir = "C:\DownloadingDirectory"
for name in list_of_files:
if fnmatch.fnmatch(name,"StartingFileName*"):
with open(os.path.join(dest_dir, name), "wb") as f:
ftps.retrbinary("RETR {}".format(name), f.write)
ftps.quit()
enter code here