Created
August 11, 2020 21:55
-
-
Save thewh1teagle/8fa884ed524ae78b69ddf7a2915672b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from threading import Thread | |
| import asyncio | |
| async def f(*args): | |
| while 1: | |
| await asyncio.sleep(2) | |
| print("asyncio thread") | |
| def function(*args): | |
| asyncio.run(f(*args)) | |
| Thread(target=function).start() | |
| while 1: | |
| input() | |
| print("main thread") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment