I have a piece of code like this:
import asyncio import aiohttp from time import process_time ts = process_time() asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) async def bot(s): async with s.get('https://httpbin.org/uuid') as r: resp = await r.json() print(resp['uuid'][0]) if resp['uuid'][0] == '0': print("EUREEKA") return async def main(): async with aiohttp.ClientSession() as s: await asyncio.gather(*[bot(s) for _ in range(0, 1000)]) if __name__ == "__main__": asyncio.run(main()) te = process_time() print(te-ts) I want to stop the loop process when "EUREEKA" appears. I use return but it doesn't stop either. What is the correct way to stop it? result of code