module documentation
(source)

Utilities for dealing with processes.
Function which Search PATH for executable files with the given name.
def which(name, flags=os.X_OK): (source)

Search PATH for executable files with the given name.

On newer versions of MS-Windows, the PATHEXT environment variable will be set to the list of file extensions for files considered executable. This will normally include things like ".EXE". This function will also find files with the given name ending with any of these extensions.

On MS-Windows the only flag that has any meaning is os.F_OK. Any other flags will be ignored.

Parameters
name:strThe name for which to search.
flags:intArguments to os.access.
Returns
listA list of the full paths to files found, in the order in which they were found.