Если запустить 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
Let's come forward with #JanBhagidari to clean our water bodies and raise awareness about the cleanliness of them🏖️🌊
Take the Puneet Sankalp Pledge to tackle the issue of plastic pollution for a better tomorrow!
Visit: https://pledge.mygov.in/puneet-sankalp/
Your opinion can help us build a #NewIndia of our dreams. Tell us your ideas for Union Budget 2023-24 and join the good governance of #JanBhagidari
Visit: https://www.mygov.in/group-issue/inviting-ideas-and-suggestions-union-budget-2023-2024/
#JanBhagidari के जरिए राष्ट्रीय पोषण मिशन अब एक #JanAndolan बन गया है। इससे महिलाओं, गर्भवती और दूध पिलाने वाली माताओं, बच्चों और किशोरों की पोषण स्थिति में तेजी से सुधार देश की भावी पीढ़ी को सुरक्षित कर रहा है। #PoshanAbhiyaan2023
https://youtu.be/FKkEDtQ15tc
Rashtriya Poshan Mission now becoming a #JanAndolan with the help of #JanBhagidari
It is improving the nutritional status of women, pregnant and lactating mothers, children and adolescents. The moment is securing the future generation of India.
#PoshanAbhiyaan2023
https://youtu.be/FKkEDtQ15tc