-
Book Overview & Buying
-
Table Of Contents
Python Parallel Programming Cookbook
By :
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 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 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
It is useful to spawn a thread and pass arguments to it that tell it what work...
Change the font size
Change margin width
Change background colour