正在创建文件,但是PDF文件的文本比原始PDF少得多,只有初始文本。
import ftplib
ftp = ftplib.FTP()
ftp.connect(host='host', port=port)
ftp.login(user='uname', passwd=*****, acct='')
for file in ftp.nlst(dir_name):
with open(local_file, "wb") as f:
ftp.retrbinary("RETR " + file, f.write)
ftp.quit()