Search found 2 matches

by finefoot
Mon Jun 28, 2021 10:17 am
Forum: General Discussion and Questions
Topic: uasyncio behaves differently than regular Python asyncio: task just keeps running
Replies: 3
Views: 1643

uasyncio behaves differently than regular Python asyncio: task just keeps running

This is my example: try: import uasyncio as asyncio except ImportError: import asyncio async def count(): i = 0 while True: print(i) i += 1 await asyncio.sleep(1) async def main(): asyncio.create_task(count()) await asyncio.sleep(5) asyncio.run(main()) asyncio.run(main()) In regular Python, I get: 0...