📜  ftplib tqdm - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:21.633000             🧑  作者: Mango

代码示例1
with open(filename, 'wb') as fd:
    total = ftpclient.size(filename)

    with tqdm(total=total) as pbar:
        def callback_(data):
            l = len(data)
            pbar.update(l)
            fd.write(data)

        ftpclient.retrbinary('RETR {}'.format(filename), callback_)