, stdin=None)

Executes a command and waits for the result.

It is also possible to interrupt the execution of the command with CTRL+C on the shell terminal (only in single thread).

  • args (list) – The list of arguments for the program to execute. Arguments should be formatted as for the subprocess.Popen constructor.
  • stdin (str or bytes) – String or bytes containing the input stream for the process.

An instance of CompletedProcess containing the information about the executed process, including stdout, stderr and running time.

Return type:



CalledProcessError – When the process returns an error.