源码

下载Python 3的进度条


我需要在Python 3的文件下载过程中显示进度.
我在Stackoverflow上看到了一些主题,但考虑到我是编程的菜鸟,没有人发布完整的例子,只是它的一小部分,或者我可以在Python 3上工作的那个,没有一个对我有好处. .

附加信息:

好的,所以我有这个:

from urllib.request import urlopen
import configparser
#checks for files which need to be downloaded
print('    Downloading...')
file = urlopen(file_url)
#progress bar here
output = open('downloaded_file.py','wb')
output.write(file.read())
output.close()
os.system('downloaded_file.py')

脚本通过python命令行运行

(1)

本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/xiazaipython-3dejindutiao.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9月 27, 2019 at 08:55 上午

热评文章