def win_find_exe(filename, installsubdir=None, env='ProgramFiles'):
 for fn in [filename, (filename + '.exe')]:
  try:
   if (installsubdir is None):
    path = _where(fn)
   else:
    path = _where(fn, dirs=[os.path.join(os.environ[env], installsubdir)])
  except IOError:
   path = filename
  else:
   break
 return path

def win_find_exe ( filename , installsubdir = None , env = 'ProgramFiles' ) : for fn in [ filename , ( filename + '.exe' ) ] : try : if ( installsubdir is None ) : path = _where ( fn ) else : path = _where ( fn , dirs = [ os . path . join ( os . environ [ env ] , installsubdir ) ] ) except IOError : path = filename else : break return path
find executable in current dir .