Если запустить REPL с модулем asyncio, то вы входите в особый асинхронный REPL.
user@host:~$ python -m asyncio
asyncio REPL 3.12.7 ...
Use "await" directly instead of "asyncio.run()".
>>> import asyncio
>>>
В этом режиме
- создаётся и настраивается event loop
- уже импортирован asyncio
- работает await на верхнем уровне
То есть такая команда сработает без ошибок!
await asyncio.sleep(3)
Удобно для тестирования асинхронных функций без создания ивентлупов и остальной обвязки.
Работает в: 3.8+
#tricks#async
@Chatbotcreatorbot
Qué puede hacer este bot?
Con este bot puedes crear tus propios Telegram Chatbots o usar plantillas existentes. No se requieren habilidades de codificación.
Idioma: Inglés
(visto en @BotsGram_cu)
#create, #chat, #development, #dev, #botbuilding
@nashrabot
Qué puede hacer este bot?
Impresionante bot para canales y propietarios de listas de publicidad te ayuda a crear publicaciones enriquecidas, podcasting en muchos canales
Idioma: Inglés
(visto en @BotsGram_cu)
#botfather, #token, #create, #development, #dev, #botbuilding