communicate

timeout_process(proc, timeout)[source]

Context manager for use in a with statement. If the with block hasn’t completed after the given number of seconds, the process is killed.

Parameters:proc – process to kill if timeout is reached before end of block
Returns:
terminate_process(proc, kill_time=None)[source]

Ends a process started with subprocess. Tries killing, then falls back on terminating if it doesn’t work.

Parameters:
  • kill_time – time to allow the process to be killed before falling back on terminating
  • proc – Popen instance
Returns:

class StreamCommunicationPacket(data)[source]

Bases: object

length
encode()[source]
static read(stream)[source]
exception StreamCommunicationError[source]

Bases: Exception