# example of running a function in another thread from time import sleep from multiprocessing import Process # a function that blocks for a moment def task(arg1, arg2): # block for a moment sleep(1) # display a message print("arg1=",arg1) print("arg2=",arg2) # create a process p = Process(target=task, args=("One",2)) # run the process p.start() # wait for the process to finish print('Waiting for the process...') p.join()