I cannot get two coroutines to execute in parallel in my Python 3.6 program. Here is an example:
import asyncio, time
def main():
loop = asyncio.get_event_loop()
loop.run_until_complete(start_coros())
async def start_coros():
await coro1()
await coro2()
async def coro1():
print("coro1")
time.sleep(3000)
async def coro2():
print("coro2 - we want to get here")
if __name__ == "__main__":
main()
As you can see, the first coroutine gets executed first but the second does not run concurrently.
Can you please give me a hint as to how to run them both simultaneously?
Thanks kindly in advance for your help