Files
UltraChat/govno/async_test.py
sShemet ade2833df7 init
2025-12-22 14:03:10 +05:00

14 lines
354 B
Python

# First we need the asyncio library
import asyncio
# Then we need a loop to work with
loop = asyncio.get_event_loop()
# We also need something to run
async def main():
for char in 'Hello, world!\n':
print(char, end='', flush=True)
await asyncio.sleep(0.5)
# Then, we need to run the loop with a task
loop.run_until_complete(main())