Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import threading
- import asyncio
- import time
- def run_async_background(coro):
- def func():
- loop = asyncio.new_event_loop()
- loop.run_until_complete(coro)
- loop.close()
- Thread(target=func).start()
- async def prin(text):
- print(str(text))
- run_async_backgroundcoro(prin(time.ctime()))
- run_async_backgroundcoro(prin(time.ctime()))
- run_async_backgroundcoro(prin(time.ctime()))
- run_async_backgroundcoro(prin(time.ctime()))
- run_async_backgroundcoro(prin(time.ctime()))
- run_async_backgroundcoro(prin(time.ctime()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement