I have a script to download CSV files from a FTP server. I have tested the script now several time. And from PyCharm there are coming no Error. It is going trough as "processed". But the problem is that it is not saving/downloading the files. I can find them in my directory.
So I have no feedback in what I am doing wrong. Can anybody help me/ tell me where I am going wrong?
from ftplib import FTP
import os
#domain name or server ip:
ftp = FTP('..')
ftp.login(user='..', passwd = '..')
savedir = '/Users/bjorn/documents/test'
os.chdir(savedir)
def grabFile():
filename = '2018-11-16-inquiries.csv'
localfile = open(filename, 'wb')
ftp.retrbinary('RETR ' + filename, localfile.write, 1024)
print filename, "done"
ftp.quit()
localfile.close()