multi_progress.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:deepjets 作者: deepjets 项目源码 文件源码
def test(location):
    """Test with a single bar.

    Input: location - tuple (x, y) defining the position on the
                      screen of the progress bar
    """
    # fd is an object that has a .write() method
    writer = Writer(location)
    pbar = ProgressBar(fd=writer)
    # progressbar usage
    pbar.start()
    for i in range(100):
        # do stuff
        # time taken for process is function of line number
        # t_wait = location[1] / 100
        # time take is random
        t_wait = random.random() / 50
        time.sleep(t_wait)
        # update calls the write method
        pbar.update(i)

    pbar.finish()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号