python3.7-progressbar

这篇博客介绍了如何在Python3.7中使用alive_progressbar库来创建进度条。作者提供了相关代码示例,将change_color模块放在指定路径,并给出了使用方法,包括自定义logo和常规logo的应用。
摘要由CSDN通过智能技术生成

本文参考其他文章

先上代码

放C:\Users\hs\AppData\Local\Programs\Python\Python37\Lib\add_module\alive_progressbar\p_b.py

import add_module.printcolor.change_color as change_color
import time

def a_process_bar(percent, logo, start_str='', str_bar='>', end_str='', total_length=0):
    bar = change_color.color.green(''.join([str_bar] * int(percent * total_length)) + '')
    bar = '\r' + start_str + '[' + bar.ljust(total_length) + '] '+  logo +' '+change_color.color.red('{:0>4.1f}%|').format(percent*100) +end_str
    print(bar, end='', flush=True)

def c_logo(logoframe=None,order=1):
    if type(logoframe) == list:
        return logoframe
    else:
        if order == 1:
            return list(' wait a moment ')
        if order == 2:
        
  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值