check for the presence of an external program on the path

Paul Clinch pclinch at
Mon Nov 17 21:53:23 CET 2003

Fernando Rodriguez <frr at> wrote in message news:<afehrvgl2p4bcjd2u89epevo0ccdhn6s0b at>...
> Hi,
> How can I find out if an executable is available in the path? 

This works on linux:-

import os


for d in ls.split(':'):
  if 'executable' in os.listdir(d):
    print 'found it!'

Regards, Paul Clinch

More information about the Python-list mailing list