I want to pass named arguments to the target function, while creating a Thread object.
Following is the code that I have written:
import threading
def f(x=None, y=None):
print x,y
t = threading.Thread(target=f, args=(x=1,y=2,))
t.start()
I get a syntax error for "x=1", in Line 6. I want to know how I can pass keyword arguments to the target function.
See Question&Answers more detail:os