Если запустить 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
A mid-career switch from worldwide travel to the tech and gaming world is unusual but for Nelly Lee, it was one of necessity. Read on to find out how she upskilled to pull it off 💪go.gov.sg/ssg-20240530tg
#SkillsFuture#Lifelonglearning
Searching for a better way to serve the community, Bony found his calling in the healthcare industry 🩺 Discover why Bony made the switch here 👉https://go.gov.sg/ssg-20241003tg1
#SkillsFuture#LifelongLearning#Midcareer
With graduation round the corner, Norazlina is eager to explore her next educational pursuits 🎓 Discover her upskilling journey here ➡️https://go.gov.sg/ssg-20240903tg
#SkillsFuture#LifelongLearning#Midcareer
Are you at a pivotal point in your career? 🤔 Seek guidance through our Skills and Training Advisory to chart the most optimal route forward for your professional journey 👉🏻go.gov.sg/ssg-20240521tg
#SkillsFuture#Lifelonglearning#midcareer