def background(f):
 t = Thread(target=f)
 t.start()
 return t

def background ( f ) : t = Thread ( target = f ) t . start ( ) return t
a function decorator to run a long-running function as a background thread .