pysqa.utils.execute.execute_command

pysqa.utils.execute.execute_command#

pysqa.utils.execute.execute_command(commands: str, working_directory: str | None = None, split_output: bool = True, shell: bool = False, error_filename: str = 'pysqa.err') str[source]#

A wrapper around the subprocess.check_output function.

Parameters:
  • commands (list/str) – These commands are executed on the command line

  • working_directory (str/None) – The directory where the command is executed

  • split_output (bool) – Boolean flag to split newlines in the output

  • shell (bool) – Additional switch to convert list of commands to one string

  • error_filename (str) – In case the execution fails the output is written to this file

Returns:

output of the shell command either as string or as a list of strings

Return type:

str/list