Skip to content

Instantly share code, notes, and snippets.

@thewh1teagle
Created August 11, 2020 21:55
Show Gist options
  • Select an option

  • Save thewh1teagle/8fa884ed524ae78b69ddf7a2915672b4 to your computer and use it in GitHub Desktop.

Select an option

Save thewh1teagle/8fa884ed524ae78b69ddf7a2915672b4 to your computer and use it in GitHub Desktop.
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