当前位置:网站首页>ftplib+ tqdm 上传下载进度条
ftplib+ tqdm 上传下载进度条
2022-06-30 06:41:00 【洪大宇】
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_)
边栏推荐
- Basic use of markdown
- Porting RT thread to s5p4418 (II): dynamic memory management
- Traitement d'images 7 - amélioration d'images
- Static routing job
- Gazebo model modification
- Never forget the original intention, and be lazy if you can: C # operate word files
- GO安装以及配置(1)
- Rhcsa day 1
- 力扣------替换空格
- SOC项目AHB_SD_HOST控制器设计
猜你喜欢
Static routing job
Principle: webmvcconfigurer and webmvcconfigurationsupport pit avoidance Guide
RT thread Kernel Implementation (II): critical area, object container
图片。。。。。
01. regular expression overview
How does Altium designer hide some temporarily unnecessary classes, such as GND
Win10 /11 开热点无法上网问题
RT thread Kernel Implementation (I): threads and scheduling
Four tips in numpy
圖像處理7-圖像增强
随机推荐
Initial love with mqtt
Is Huatai stock trading safe? I want to open an account online.
Wechat applet mall project
银河麒麟初体验
Base64 explanation: playing with pictures Base64 encoding
Deep learning --- the weight of the three good students' scores (3)
Imxq Freescale yocto project compilation record
INI analyse les documents d'apprentissage
明天!“移动云杯”大赛空宣会开播!
Write a C program to judge whether the system is large end byte order or small end byte order
1.3 - Code System
Unable to read file for extraction: gdx64. dll
1.5 - 逻辑运算
To: k210 realizes face recognition (code interpretation attached)
Basic use of markdown
1.5 - logical operation
【微信小程序:单选、多选样式,背景色,圆角】
Altium designer creates multiple class networks to realize different lineweights of multiple networks
New project folder based on PIO plug-in in vscode -- Interpretation
Keil - the "trace HW not present" appears during download debugging