From python Standard Library manual :
commands.getstatusoutput(cmd)
Execute the string cmd in a shell with os.popen() and return a 2-tuple (status, output).
cmd is actually run as { cmd ; } 2>&1, so that the returned output will contain output or
error messages. A trailing newline is stripped from the output. The exit status for the
command can be interpreted according to the rules for the C function wait().
The syntax {}
is correctily interpreted by Linux or other Unix like shells, but not by Windows cmd.exe
.
As others suggested to, try to use subprocess
... and read the manual ...