On Wednesday 19 May 2004 09:05, Angus Leeming wrote: > Jose, > > def find_exe(candidates, path): > for prog in candidates: > for directory in path: > - full_path = os.path.join(directory, prog) > + full_path = os.path.join(directory, prog + ".exe")
Roughly the code should look like this: if os.name == "nt": full_path = os.path.join(directory, prog + ".exe") else: full_path = os.path.join(directory, prog) This can be done earlier in the candidates stage, but you get the idea. :-) > if os.access(full_path, os.X_OK): > return full_path > > return None > Angus -- José Abílio LyX and docbook, a perfect match. :-)