Note that I steered my discussion away from the shell. I’m talking about API calls that search PATH
(or some other search path), such as os.execlp()
, and Python’s shutil.which()
and subprocess.Popen
. For example:
>>> shutil.which('./ls') is None
True
>>> shutil.which(pathlib.Path('./ls'))
'/usr/bin/ls'