Examples from the book Working with Unix Processes rewritten in Python