Package Gnumed :: Package pycommon :: Module gmShellAPI |
[frames] | no frames]

# Module gmShellAPI

source code

GNUmed general tools.

Author: K. Hilbert <Karsten.Hilbert@gmx.net>

License: GPL v2 or later (details at http://www.gnu.org)

Functions
is_cmd_in_path(cmd=None) | source code
is_executable_by_wine(cmd=None) | source code
detect_external_binary(binary=None) <binary> is the name of the executable with or without .exe/.bat | source code
find_first_binary(binaries=None) | source code
run_command_in_shell(command=None, blocking=False, acceptable_return_codes=None) Runs a command in a subshell via standard-C system(). | source code
run_first_available_in_shell(binaries=None, args=None, blocking=False, run_last_one_anyway=False, acceptable_return_codes=None) | source code

Variables
| __doc__ = `"""GNUmed general tools."""`
| __package__ = ``'``Gnumed.pycommon``'``

Imports: os, sys, logging, subprocess, shlex

Function Details

### run_command_in_shell(command=None, blocking=False, acceptable_return_codes=None) | source code
    Runs a command in a subshell via standard-C system().

    <command>
            The shell command to run including command line options.
    <blocking>
            This will make the code *block* until the shell command exits.
            It will likely only work on UNIX shells where "cmd &" makes sense.

    http://stackoverflow.com/questions/35817/how-to-escape-os-system-calls-in-python