Conditions | 5 |
Total Lines | 8 |
Lines | 0 |
Ratio | 0 % |
1 | #!/usr/bin/env python |
||
24 | def which(name, |
||
25 | env_path=[path.strip('"') for path in os.environ['PATH'].split(os.pathsep)], |
||
26 | is_executable_fnc=lambda path: (os.path.isfile(path) and os.access(path, os.X_OK))): |
||
27 | for path in env_path: |
||
28 | exe_file = os.path.join(path, name) |
||
29 | if is_executable_fnc(exe_file): |
||
30 | return exe_file |
||
31 | return None |
||
32 |