Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
如何在 Jupyter Notebook 中运行 Python 异步代码?
我有一些 asyncio 代码在 Python 解释器 CPython 3 6 2 中运行良好 我现在想在具有 IPython 内核的 Jupyter 笔记本中运行它 我可以运行它 import asyncio asyncio get ev
python
jupyternotebook
jupyter
pythonasyncio
如何使用 asyncio/aiohttp 确定最佳缓冲区大小
在 python 中使用 asyncio 时 我们如何确定 read 的最佳参数 12字节 100 字节 async with self session get url headers headers as response chunk s
python
pythonasyncio
aiohttp
asyncio.gather 中的任务不能同时工作
我想同时从网站上抓取数据 但我发现以下程序没有同时执行 async def return soup url r requests get url r encoding utf 8 soup BeautifulSoup r text html
python
pythonasyncio
异步异常处理程序:在事件循环线程停止之前不会被调用
我正在我的异步事件循环上设置异常处理程序 但是 在事件循环线程停止之前 它似乎不会被调用 例如 考虑以下代码 def exception handler loop context print Exception handler called
python
pythonasyncio
Python 3.6 ZeroMQ (PyZMQ) asyncio pub sub Hello World
我刚刚开始使用 ZeroMQ 我正在尝试让 Hello World 在 Python 3 6 中与 PyZMQ 和 asyncio 一起使用 我试图将模块的功能与发布 订阅代码分离 因此有以下类设置 Edit 1 最小化示例 Edit 2
python3x
zeromq
pythonasyncio
pyzmq
使用 asyncio 时应该如何创建属性?
在创建使用 asyncio 的类时 我发现自己处于属性 getter 需要进行 io 操作的情况 因此该函数应该是一个协程 然而 等待房产的感觉却很不寻常 这是我的意思的一个最小的例子 该代码有效并且可以运行 import asyncio
python
python3x
pythonasyncio
Django Channels Postgres InterfaceError:连接已关闭
我似乎无法理解这里的问题 我正在为我的渠道消费者编写测试文档中的描述 https channels readthedocs io en latest topics testing html 我通常会使用 Django 默认的单元测试 但由于
django
postgresql
Pytest
pythonasyncio
djangochannels
如何使用 python aiohttp 连接到 .onion 网站?
我正在尝试连接到 onion使用 python 的网站 我在端口 9050 上运行 Tor 但收到以下错误 Traceback most recent call last File Users jane code test test py
python3x
pythonasyncio
TOR
aiohttp
Socks
在 grpc python 中处理异步流请求
我试图了解如何使用双向流处理 grpc api 使用 Python API 假设我有以下简单的服务器定义 syntax proto3 package simple service TestService rpc Translate stre
python
pythonasyncio
gRPC
grpcpython
如何将同步函数包装在异步协程中?
我在用着aiohttp https github com aio libs aiohttp构建一个 API 服务器 将 TCP 请求发送到单独的服务器 发送 TCP 请求的模块是同步的 对于我来说是一个黑匣子 所以我的问题是这些请求阻塞了整
python
python3x
Asynchronous
pythonasyncio
aiohttp
如何测量异步发电机所花费的时间?
我想测量生成器花费的时间 阻塞主循环的时间 假设我有以下两个生成器 async def run for i in range 5 await asyncio sleep 0 2 yield i return async def walk f
python
python3x
pythonasyncio
Generator
Nest_asyncio 的正确使用/使用限制?
我正在努力将以前的同步网络服务器作为同步服务器 我的大多数函数都是同步的 我想简单地从现有代码进行异步调用以避免异步蔓延 Nest asyncio 似乎通过使 run until complete 可重入来允许这样做 然而 虽然这适用于 1
python
pythonasyncio
nestasyncio
asyncio 多个并发服务器
我正在尝试使用 Python 的 asyncio 一起运行多个服务器 并在它们之间传递数据 对于我的具体情况 我需要一个带有 websocket 的 Web 服务器 与外部设备的 UDP 连接以及数据库和其他交互 我可以找到几乎所有这些单独
python
python3x
pythonasyncio
aiohttp
Python Asyncio run_forever() 和任务
我改编了这段代码 以便在异步 Python 中使用 Google Cloud PubSub https github com cloudfind google pubsub asyncio https github com cloudfin
python
googlecloudplatform
pythonasyncio
多个 aiohttp Application() 在同一进程中运行?
Can two aiohttp web Application 对象在同一进程中运行 例如在不同的端口上 我看到了一堆 aiohttp 代码的示例 例如 from aiohttp import web app web Application
python
pythonasyncio
aiohttp
AIORedis 和 PUB/SUB 不是 asnyc
I used aioredis http aioredis readthedocs org en latest examples html用于编写异步服务 该服务将侦听某个通道并以异步方式运行一些命令 基本上我从示例页面 http aior
python
Asynchronous
pythonasyncio
redis 阻塞直到 key 存在
我是 Redis 新手 想知道是否有办法能够await get通过它的键来获取值 直到该键存在 最小代码 async def handler data await self fetch key async def fetch key ret
python
Asynchronous
Redis
pythonasyncio
python asyncio 中的“Executing
在设置 asyncio future 的结果时会打印下面的消息 Executing
python
Future
pythonasyncio
间歇性的“事件循环在 Future 完成之前停止。”
我一直在为这个问题抓狂 有问题的代码是此处开源项目的一部分 aiosmtpd https github com pepoluan aiosmtpd 我的实际 FOSS 项目的分支 here https github com aio libs
python3x
pythonasyncio
Python Asyncio 子进程永远不会完成
我有一个简单的 python 程序 我用它来测试带有子进程的 asyncio import sys time for x in range 100 print processing s 100 x sys stdout flush prin
python
pythonasyncio
1
2
3
4
5
6
...12
»