import thread # This is called in a new thread def do_import(lock): apply(lambda: 0, ()) lock.release() # Lock for simply simple synch. lock=thread.allocate_lock() lock.acquire() thread.start_new(do_import, (lock,)) lock.acquire() print "Imported"