When it comes to operating systems, it is unavoidable to use the OS module, and sometimes the Sys module.
Process actions
The Os.system () function can start a process and return a status code after execution.
Os.fork () Copy a process, if it is a child process return 0, if the parent process returns the PID of the child process, when using this function, it is recommended that you learn the knowledge of Linux programming.
Os.popen creates a process in a pipeline.
OS.SPAWNL can also create processes, and can specify environment variables.
Os.kill (PID, SIG) closes a process, PID is the process number, and the sig is the signal. Used with fork, for example, you just created a sub-process with fork, its PID is 11990, then call
Os.kill (11990, signal. Ctrl_break_event)
The process was killed in the form of CTRL + C.
There is also a module multiprocessing, which encapsulates many of the operations that create processes and interprocess communication, allowing you to perform multicore power.
File operations
For more information on file operations see http://www.cnblogs.com/xinchrome/p/5011304.html
Multithreading Threading & Thread
Multi-process multiprocessing
Thread concurrency control lock semaphore
Process Communication Signal
Python operations related to the operating system, threads, and processes