Если запустить 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
The euro banknotes feature the name of the currency in how many different scripts?
(hidden behind the cat in the image)
Options:
A) 1
B) 2
C) 3
D) 4
@languagetrivia#script
#Python#script
🤖
PlotAI
PlotAI es una herramienta para generar gráficos en Matplotlib.
— el usuario envía un marco de datos como entrada;
— PlotAI crea un mensaje para LLM, que contiene los primeros cinco registros y genera código Python;
- Se ejecuta el código Python devuelto y se muestra el gráfico.
pip install plotai
🔗Github
-----
Main channel: @repo_science
Coupons: @freecoupons_reposcience
-----
🌍 Which African country uses Amharic as an official language?
A) 🇪🇹 Ethiopia
B) 🇪🇷 Eritrea
C) 🇸🇴 Somalia
D) 🇸🇩 Sudan
@languagetrivia#guess_the_country#script
Which language is written in a script called ‘Devanagari’, a script characterized by a horizontal line running along the top of the letters, connecting them?
Follow @languagetrivia🌏 for more!
#script#image#guess_the_language