当前位置:网站首页>ftplib+ tqdm upload and download progress bar
ftplib+ tqdm upload and download progress bar
2022-08-09 13:43:00 【Hong Dayu】
from fileinput import filename
import tqdm
import ftplib
server = "192.168.119.100"
port = 2121
ftp = ftplib.FTP()
#ftp.set_debuglevel(2)
ftp.connect(server,port)
ftp.login()
pwd = ftp.pwd()
ftp.cwd("xilinx")
filename="u-boot-xlnx-xilinx-v2021.2.zip"
size = ftp.size(filename)/1024
from tqdm import tqdm
import time
#fd = open(filename,"wb")
# with tqdm(total=size,desc='Download {}'.format(filename)) as pbar:
# def call_(data):
# l = len(data)/1024
# pbar.update(l)
# fd.write(data)
# ftp.retrbinary("RETR {}".format(filename),call_)
import os
filename="u-boot-xlnx-xilinx-v2021.2-debug.zip"
size = os.path.getsize(filename)/1024
fp = open(filename,"rb")
with tqdm(total=size,desc='Download {}'.format(filename)) as pbar:
def call_(data):
l = len(data)/1024
pbar.update(l)
ftp.storbinary("STOR {}".format(filename),fp,callback=call_)
边栏推荐
- 电脑重装系统后桌面图标如何调小尺寸
- Redis源码剖析之字典(dict)
- 26、管道参数替换命令xargs
- telnet+ftp 对设备进行 操控 和 升级
- 链表噩梦之一?5000多字带你弄清它的来龙去脉
- 十六进制字符→十进制数字
- 第六届”蓝帽杯“全国大学生网络安全技能大赛 半决赛
- Compensation transaction and idempotency guarantee based on CAP components
- Flutter Getting Started and Advanced Tour (4) Text Input Widget TextField
- 流量焦虑背后是企业对客户关系管理的不足
猜你喜欢
用 API Factory 产品生成 API 文档
Flutter入门进阶之旅(六)Layout Widget
Intra-group reverse order adjustment of K nodes
Go 事,如何成为一个Gopher ,并在7天找到 Go 语言相关工作,第1篇
Flutter入门进阶之旅(二)Hello Flutter
Flutter Getting Started and Advanced Tour (8) Button Widget
AQS Synchronization Component - FutureTask Analysis and Use Cases
Intranet penetration tool ngrok usage tutorial
电脑重装系统还原0x80070005错误如何解决
Rust 入门指南(使用JSON)
随机推荐
造自己的芯,让谷歌买单!谷歌再度开源 180nm 工艺的芯片
Do you know the difference between comments, keywords, and identifiers?
Scala Advanced (7): Collection Content Summary (Part 1)
卷积神经网络表征可视化研究综述(1)
工作任务统计
ERP不规范,同事两行泪 (转载非原创)
Extract EventBus encapsulation to base class using annotations
技术分享 | 接口自动化测试如何处理 Header cookie
Scala 高阶(七):集合内容汇总(上篇)
Say goodbye to the AI era of hand looms
腾讯发布第二代四足机器人Max,梅花桩上完成跳跃、空翻
【FPGA教程案例48】图像案例8——基于FPGA的RGB图像转化为HSV图像的实现,通过MATLAB进行辅助验证
Fragment中嵌套ViewPager数据空白页异常问题分析
一维数组&指针
JVM之配置介绍(一)
史上最猛“员工”,疯狂吐槽亿万富翁老板小扎:那么有钱,还总穿着同样的衣服!...
农村区县域农业电商如何做?数字化转型如何进行?
FPGA中串口通信的时钟频率和波特率计数
5G China unicom 一般性异常处理
ansible-cmdb友好展示ansible收集主机信息