_exec

guerilla._exec(cmd, env, dir, synchronous, console)

Execute a command line in a new shell context

Under Linux, execution of the command is always asynchronous, thus the returned code never reflects the actual returned code of the command line. Use os.execute for synchronous execution.

Parameters:
  • cmd (str) – The command line to execute
  • env (str) – Additionnal environment set when executing the command line, <b>only on Windows</b>
  • dir (str) – The current directory to execute the command line, <b>only on Windows</b>
  • synchronous (bool) – Should Guerilla wait for the command to proceed, <b>only on Windows, Linux is asynchronous only</b>
  • console (bool) – Should Guerilla execute the command in a new term/console
Returns:

The return code of the command, <b>only when the command is called in synchronous mode</b>

Return type:

int