Если запустить 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
🪐 In 2022, scientists used data from the Atacama Cosmology Telescope in Chile to make the sharpest-ever map of the cosmic microwave background’s subtle temperature patterns. This ancient light, which blankets galaxies like our Milky Way, holds whisper-faint traces left by the first matter clumps—revealing how gravity, even in the universe’s earliest moments, started pulling atoms together to form all the cosmic structures we see today. ✨
#microwave⚡#background⚡#universe⚡#gravity⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The cosmic microwave background (CMB) is a faint glow that fills the universe, left over from when the cosmos was just 380,000 years old. Tiny temperature differences in the CMB, first mapped in detail by the Planck satellite, reveal subtle "hot" and "cold" spots—clues to how galaxies, like the Milky Way and Andromeda, began to form from small ripples in the early universe. ✨
#microwave⚡#background⚡#universe⚡#Planck⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 The cosmic microwave background contains faint "Sunyaev-Zel’dovich effects," which happen when the ancient microwave light passes through hot gas in galaxy clusters like the Bullet Cluster. This process boosts the energy of some photons (light particles), leaving tiny shadows in the background glow—allowing astronomers to map both distant galaxy clusters and the hot plasma between galaxies by studying these subtle marks in the oldest light in the universe. ✨
#microwave⚡#background⚡#galaxyclusters⚡#plasma⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels