MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / which

Function which

python/pymesh/boolean_unsupported.py:18–37  ·  view source on GitHub ↗

Determine the full path of an executable. Copied from http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python/377028#377028

(program)

Source from the content-addressed store, hash-verified

16from .meshio import save_mesh, load_mesh, form_mesh
17
18def which(program):
19 """ Determine the full path of an executable.
20
21 Copied from http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python/377028#377028
22 """
23 def is_exe(fpath):
24 return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
25
26 fpath, fname = os.path.split(program)
27 if fpath:
28 if is_exe(program):
29 return program
30 else:
31 for path in os.environ["PATH"].split(os.pathsep):
32 path = path.strip('"')
33 exe_file = os.path.join(path, program)
34 if is_exe(exe_file):
35 return exe_file
36
37 return None
38
39def quick_csg(mesh_1, mesh_2, operation, with_timing=False):
40 exe_name = None

Callers 1

quick_csgFunction · 0.85

Calls 1

is_exeFunction · 0.85

Tested by

no test coverage detected