Re: Find the path of a shell command (shutil.which)

2022-10-12 Thread Eryk Sun
On 10/12/22, Weatherby,Gerard wrote: > > When no path is specified, the results of > os.environ() are used, > returning either the “PATH” value or a fallback of > os.defpath. The documentat

Re: Find the path of a shell command (shutil.which)

2022-10-12 Thread Weatherby,Gerard
Not going to do any good if it’s not on the PATH in the first place: https://docs.python.org/3/library/shutil.html shutil.which(cmd, mode=os.F_OK | os.X_OK, path=None) Return the path to an executable which would be run if the given cmd was called. If no cmd would be called, return None. mode is