【发布时间】:2019-10-15 06:05:31
【问题描述】:
我正在使用 curl 命令下载文件并打开子进程来运行该命令。 我想把下载的限制速率控制在50mps。
当我在终端中运行低于 commad 时,它工作正常。
curl -o down.tar.gz --limit-rate 50M http://localhost:5000/download
但是当我运行 Popen 以在 pycharm 中运行该命令时,如下所示,
Popen(['curl', '-o', 'down.tar.gz','--limit-rate 50M', 'http://localhost:5000/download'])
然后它给我如下所示的错误,
curl: option --limit-rate 50M: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
如何在 Popen 中使用 curl 限制速率?
【问题讨论】:
标签: python-3.x curl subprocess popen