当前位置:网站首页>Ftplib+ tqdm upload and download progress bar
Ftplib+ tqdm upload and download progress bar
2022-06-30 06:49:00 【Hongdayu】
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_)
边栏推荐
- Deep learning --- the weight of the three good students' scores (3)
- 基础刷题(一)
- The 40g high-efficiency cloud disk purchased by Alibaba cloud is only 20g attached
- 1.2 (supplementary)
- RT thread migration to s5p4418 (I): scheduler
- Practice summary of Prometheus project in amu Laboratory
- memcpy内存重叠的解决
- CPU到底是怎么识别代码的?
- Several C language implementations
- 华泰炒股安全吗?我想网上开户。
猜你喜欢
随机推荐
RT thread migration to s5p4418 (I): scheduler
File transfer protocol, FTP file sharing server
MySQL中的InnoDB引擎
Software tools_ Shortcut_ Operation summary
1.8 - multi level storage
成品升级程序
Relevant database questions.
Four ways to create multithreads
Rising posture series: fancy debugging information
史上最全一句话木马
IO streams (common streams)
gazebo/set_ model_ State topic driving UAV model through posture
The most complete sentence in history
Cmake post makefile:32: * * * missing separator Stop.
It turns out that you are such an array. You have finally learned
Suggestion: use tools:overrideLibrary
[my creation anniversary] one year anniversary essay
0基础转行软件测试,如何实现月薪9.5k+
SOC_AHB_SD_IF
Install the components corresponding to setup









