How it works...

Note that only the daemon parameter of the process defines whether the process should run in the background or not. To run this example, type the following command:

> python run_background_processes.py

The output clearly reports only the NO_background_process output:

Starting NO_background_process
---> 5

---> 6

---> 7

---> 8

---> 9
Exiting NO_background_process

The output changes the setting of the daemon parameter for background_process to False:

background_process.daemon = False

To run this example, type the following:

C:>python run_background_processes_no_daemons.py

The output reports the execution of both the background_process and NO_background_process processes:

Starting NO_background_process
Starting background_process
---> 5

---> 0
---> 6

---> 1
---> 7

---> 2
---> 8

---> 3
---> 9

---> 4

Exiting NO_background_process
Exiting background_process
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.226.105