def exec_command(self, command, getOutput=True):
if getOutput:<EOL><INDENT>with subprocess.Popen(<EOL>command,<EOL>shell=True,<EOL>bufsize=-<NUM_LIT:1>,<EOL>stdout=subprocess.PIPE,<EOL>universal_newlines=True) as p:<EOL><INDENT>output = p.communicate()[<NUM_LIT:0>][:-<NUM_LIT:1>]  <EOL>if p.returncode:<EOL><INDENT>raise subprocess.CalledProcessError(p.returncode, output)<EOL><DEDENT>return output<EOL><DEDENT><DEDENT>else:<EOL><INDENT>subprocess.Popen(command, shell=True, bufsize=-<NUM_LIT:1>)<EOL><DEDENT>
Execute a shell command

Usage: C{system.exec_command(command, getOutput=True)}

Set getOutput to False if the command does not exit and return immediately. Otherwise
AutoKey will not respond to any hotkeys/abbreviations etc until the process started
by the command exits.

@param command: command to be executed (including any arguments) - e.g. "ls -l"
@param getOutput: whether to capture the (stdout) output of the command
@raise subprocess.CalledProcessError: if the command returns a non-zero exit code