Created
December 10, 2016 05:09
-
-
Save brendandburns/1da6cdfa00e3b9a2f772d4fe4a8262b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| path = os.Getenv('PATH') | |
| if platform.system() == 'Windows': | |
| parts = path.split(';') | |
| else: | |
| parts = path.split(':') | |
| for part in parts: | |
| path = os.path.join(part, bin) | |
| if os.path.exists(path) and os.access(path, os.X_OK): | |
| return path | |
| return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment