Checking the list of running processes is accomplished (even by core utilities like "ps") by looking at the contents of the /proc directory.
As such, the library you're interested for querying running processes is the same as used for working with any other files and directories (i.e. sys
or os
, depending on the flavor you're after. Pay special attention to os.path
though, it does most of what you're after). To terminate or otherwise interact with processes, you send them signals, which is accomplished with os.kill
. Finally, you start new processes using os.popen
and friends.