Is there a way to set title/name of a thread in Python? [duplicate] Is there a way to set title/name of a thread in Python? [duplicate] multithreading multithreading

Is there a way to set title/name of a thread in Python? [duplicate]


Try this:

def your_function(arg1, arg2, argn):    * do stuff *new_thread = threading.Thread(target=your_function, args=(arg1, arg2, argn))new_thread.name = 'your name'new.thread.start()

Where new_thread.name is your answer.


Just do the following:t = threading.Thread(name='my_thread')