The Python threading module provides a Thread class that is used to run processes and functions in a different thread:
class threading.Thread(group=None, target=None, name=None, args=(), kwargs={})
Here are the parameters of the Thread class:
- group: This is the group value, which should be None; this is reserved for future implementations.
- target: This is the function that is to be executed when you start a thread activity.
- name: This is the name of the thread; by default, a unique name of the form of Thread-N is assigned to it.
- args: This is the tuple of arguments that are to be passed to a target.
- kwargs: This is the dictionary of keyword arguments that are to be used for the target function.
In the next section, let's learn about how to define a thread.