FlightDeck/utils/os_utils.py

11 строки
343 B
Python
Исходник Обычный вид История

2010-10-01 22:25:56 +04:00
# from http://jimmyg.org/blog/2009/working-with-python-subprocess.html
2010-03-08 15:28:06 +03:00
import os
2010-10-01 22:25:56 +04:00
def whereis(program):
for path in os.environ.get('PATH', '').split(':'):
if os.path.exists(os.path.join(path, program)) and \
not os.path.isdir(os.path.join(path, program)):
return os.path.join(path, program)
return None