shell
Platypush documentation
shell
- class platypush.plugins.shell.ShellPlugin(**kwargs)[source]
Bases:
Plugin
Plugin to run custom shell commands.
- exec(cmd, background=False, ignore_errors=False)[source]
Execute a command.
- Parameters:
cmd (str) – Command to execute
background – If set to True, execute the process in the background, otherwise wait for the process termination and return its output (deafult: False).
ignore_errors – If set, then any errors in the command execution will be ignored. Otherwise a RuntimeError will be thrown (default value: False)
- Returns:
A response object where the
output
field will contain the command output as a string, and theerrors
field will contain whatever was sent to stderr.