xcp_d.utils.filemanip.which
- xcp_d.utils.filemanip.which(cmd, env=None, pathext=None)[source]
Return the path to an executable which would be run if the given cmd was called.
If no cmd would be called, return
None
.Code for Python < 3.3 is based on a code snippet from http://orip.org/2009/08/python-checking-if-executable-exists-in.html