Skip to content

Instantly share code, notes, and snippets.

@codl
Created September 4, 2017 10:31
Show Gist options
  • Save codl/7e05f74e0ce26e67a328a914b1ef4075 to your computer and use it in GitHub Desktop.
Save codl/7e05f74e0ce26e67a328a914b1ef4075 to your computer and use it in GitHub Desktop.
from threading import Thread
from functools import wraps
def background(fun):
@wraps(fun)
def wrapper(*args, **kwargs):
Thread(target=fun, args=args, kwargs=kwargs).start()
return wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment