MCPcopy Create free account
hub / github.com/ActiveState/code / _which

Function _which

recipes/Python/577191_IP_and_MAC_addresses/recipe-577191.py:108–121  ·  view source on GitHub ↗
(exe, dirs)

Source from the content-addressed store, hash-verified

106
107
108def _which(exe, dirs):
109 # return full path of an executable.
110 p = _exes.get(exe, None)
111 if p is None:
112 for d in dirs:
113 p = os.path.join(d, exe)
114 if os.access(p, os.X_OK):
115 break
116 else:
117 p = '' # no such exe
118 _exes[exe] = p
119 if _debugf:
120 _debugf('_which(%r): %r', exe, p)
121 return p
122
123
124if sys.platform.startswith('win'):

Callers 6

_ipconfigFunction · 0.70
_runFunction · 0.70
_ifconfig_ipsFunction · 0.70
_ifconfig_macsFunction · 0.70
_arp_macsFunction · 0.70
_lanscan_macsFunction · 0.70

Calls 3

getMethod · 0.45
joinMethod · 0.45
accessMethod · 0.45

Tested by

no test coverage detected