August 2015
Intermediate to advanced
286 pages
5h 42m
English
The simplest way to use a thread is to instantiate it with a target function and then call the start() method to let it begin its work. The Python module threading has the Thread() method that is used to run processes and functions in a different thread:
class threading.Thread(group=None,
target=None,
name=None,
args=(),
kwargs={}) In the preceding code:
group: This is the value of group that should be None; this is reserved for future implementationstarget: This is the function that is to be executed when you start a thread activityname: This is the name of the thread; by default, a unique name of the form Thread-N is assigned to itargs: This is the tuple of arguments that are to be passed to a targetkwargs: This is the dictionary ...Read now
Unlock full access