当前位置:网站首页>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_)
边栏推荐
- 不忘初心,能偷懒就偷懒:C#操作Word文件
- To: k210 realizes face recognition (code interpretation attached)
- Is Huatai stock trading safe? I want to open an account online.
- Fastapi learning Day2
- Graphic octet, really top
- 【Mask-RCNN】基于Mask-RCNN的目标检测和识别
- Usage of case, casez and casex statements in Verilog
- RT thread Kernel Implementation (II): critical area, object container
- C语言:练习题三
- 1.4 - 定点数与浮点数
猜你喜欢
随机推荐
How does Altium designer hide some temporarily unnecessary classes, such as GND
Bat usage details 2
Getting started with research
Cocos studio3.1 installation package win
1.7 - CPU performance indicators
1.6 - CPU组成
KEIL - 下载调试出现“TRACE HW not present”
银河麒麟初体验
Judge whether H5 is in wechat environment or enterprise wechat environment at both ends
Centos8 install redis
基础刷题(一)
Combat simulation system data
Arrangement of in-depth learning materials
Deep learning --- the weight of the three good students' scores (3)
Write a C program to judge whether the system is large end byte order or small end byte order
Subnet division and subnet summary
A small template (an abstract class, a complete process is written in a method, the uncertain part is written in the abstract method, and then the subclass inherits the abstract class, and the subclas
0基础转行软件测试,如何实现月薪9.5k+
[my creation anniversary] one year anniversary essay
判断h5在两端是在微信环境还是企业微信环境









