Miscellaneous operating system functions¶
-
sage.misc.sage_ostools.
have_program
(program, path=None)¶ Return
True
if aprogram
executable is found in the path given bypath
.INPUT:
program
- a string, the name of the program to check.path
- string or None. Paths to search forprogram
, separated byos.pathsep
. IfNone
, use thePATH
environment variable.
OUTPUT: bool
EXAMPLES:
sage: from sage.misc.sage_ostools import have_program sage: have_program('ls') True sage: have_program('there_is_not_a_program_with_this_name') False sage: have_program('ls', path=SAGE_ROOT) False