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? sleeping 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 中的带宽限制
基础教程推荐
- 求两个直方图的卷积 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 包装空间模型 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
