【发布时间】:2011-10-31 01:00:54
【问题描述】:
在 Python 中,如果我使用“wget”通过 os.system("wget) 下载文件,它会在屏幕上显示如下:
Resolving...
Connecting to ...
HTTP request sent, awaiting response...
100%[====================================================================================================================================================================>] 19,535,176 8.10M/s in 2.3s
等在屏幕上。
如何将此输出保存在某个文件中而不是在屏幕上显示?
目前我运行的命令如下:
theurl = "< file location >"
downloadCmd = "wget "+theurl
os.system(downloadCmd)
【问题讨论】:
-
你为什么首先调用 wget 而不是使用 python 标准库中的东西?
-
你能举个例子解释一下吗...
标签: python