ftphelper.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:pydwd 作者: ckaus 项目源码 文件源码
def download_file(host, file_path, file_name):
    try:
        ftp = ftplib.FTP(host)
        ftp.login()
        ftp.cwd(file_path)
        ftp.retrbinary('RETR ' + file_path + file_name, open(file_name, 'wb').write)
        logger.success('Download: %s' % host + file_path + file_name)
        ftp.quit()
    except ftplib.all_errors as e:
        logger.error('%s\nCannot download file: %s.' % (e, host + file_path + file_name))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号