Python progress bar and downloads

前端 未结 10 1167
庸人自扰
庸人自扰 2020-11-28 02:28

I have a python script that launches a URL that is a downloadable file. Is there some way to have python use commandline to display the download progress as oppose to launch

10条回答
  •  再見小時候
    2020-11-28 02:42

    I think you can also use click , and it has a good library for progress bar also.

    import click
    with click.progressbar(length=total_size, label='Downloading files') as bar:
        for file in files:
            download(file)
            bar.update(file.size)
    

    Enjoy !

提交回复
热议问题