> But I would highly suggest that someone (i.e. you) make phc detection > much more robust. "which" usually returns an error code unequal to > zero (it doesn't on Solaris :(), so that is what you should check and > otherwise throw a proper exception. >
So I ended up doing something like this on #4386, but I'd be really curious if there's a better way. In particular, here's what I did: find_phc = os.popen2('which phc')[1].readlines() if find_phc == []: raise ValueError, "phc not found" The popen2 returns a pair of file handles, the first wrapping stdin, and the second wrapping stdout. (In fact, looking at this, I realize that I forgot to close these file handles ... patch up at #4428.) So is there a better way to search your path for an executable in Python? -cc --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---