subprocess

The subprocess module contains functions and objects that generalize the task of creating new processes, controlling input and output streams, and handling return codes. The module centralizes functionality contained in a variety of other modules such as os, popen2, and commands.

Popen(args, **parms)

Executes a new command as a subprocess and returns a Popen object representing the new process. The command is specified in args as either a string, such as 'ls-l', or as a list of strings, such as ['ls', '-l']. parms represents a collection of keyword arguments that can be set to control various properties of the subprocess. The following keyword parameters are understood:

KeywordDescription
bufsizeSpecifies the buffering behavior, where ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.