Bandwidth throttling in Python(Python 中的带宽限制)
问题描述
有哪些库可以让您控制网络请求(尤其是 http)的下载速度.我没有看到 urllib2 中的任何内置内容(也没有在我打算使用的 (Py)Qt 中).
What libraries out there let you control the download speed of network requests (http in particular). I don't see anything built-in in urllib2 (nor in (Py)Qt which I intend on using).
Twisted 可以控制带宽吗?如果没有,如何控制 urllib2 或 Twisted 的读取缓冲区大小?sleep
不能暂停网络操作.
Can Twisted control bandwidth? If not, how can I control the read buffer size of urllib2 or Twisted? sleep
ing to suspend network operations isn't an option.
推荐答案
当然twisted可以.你想要 twisted.protocols.policies.ThrottlingFactory代码>.只需将现有工厂包装在其中,然后再将其传递给任何想要的工厂.
Of course twisted can. You want twisted.protocols.policies.ThrottlingFactory
. Just wrap your existing factory in it before you pass it to whatever wants a factory.
这篇关于Python 中的带宽限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Python 中的带宽限制


- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01