@deceze answer is probably the best you can do in Python 3.6.
But in Python 3.7, you could directly use asyncio.run
in the following way:
newfeature = asyncio.run(main(urls))
It will properly create, handle, and close an event_loop
.
@deceze answer is probably the best you can do in Python 3.6.
But in Python 3.7, you could directly use asyncio.run
in the following way:
newfeature = asyncio.run(main(urls))
It will properly create, handle, and close an event_loop
.