当前位置:网站首页>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_)
边栏推荐
- Which securities company is good for opening a mobile account? Also, is it safe to open an account online?
- Write a C program to judge whether the system is large end byte order or small end byte order
- 1.3 - Code System
- leetcode:98. 验证二叉搜索树
- SOC项目AHB_SD_HOST控制器设计
- Collections tool class (V)
- 2020-10-06
- CPU到底是怎么识别代码的?
- ROS service communication programming
- 1.9 - Classification of memory
猜你喜欢

Huawei full-scale Daniel shared the 598 page full-color Manual of network protocols for the first time

Principle: webmvcconfigurer and webmvcconfigurationsupport pit avoidance Guide

GO安装以及配置(1)

Deep learning --- the weight of the three good students' scores (3)

【我的创作纪念日】一周年随笔

基础刷题(一)

0 basic job transfer software test, how to achieve a monthly salary of 9.5k+

0基础转行软件测试,如何实现月薪9.5k+

1.2(补充)

The most complete sentence in history
随机推荐
安装setup对应的组件
Wuenda coursera deep learning course
High performance distributed execution framework ray
Gazebo installation, uninstall and upgrade
SOC project AHB_ SD_ Host controller design
Imxq Freescale yocto project compilation record
银河麒麟初体验
Basic questions (I)
Relevant database questions.
Inner member of class 5: inner class
Use of sscanf function
1.7 - CPU performance indicators
1.3 - 码制
Performance comparison of random network, scale-free network, small world network and NS small world matlab simulation
Principle: webmvcconfigurer and webmvcconfigurationsupport pit avoidance Guide
SOC_ SD_ CLK
Pycharm shortcut key
Hao looking for a job
RT thread Kernel Implementation (IV): multi priority
ETL为什么经常变成ELT甚至LET?