In python, is there a portable and simple way to test if an executable program exists?
By simple I mean something like the 'which
' command which would be just perfect. I don't want to search PATH manually or something involving trying to execute it with Popen
& al and see if it fails (that's what I'm doing now, but imagine it's launchmissiles
)
EDIT: The answer is 'No', from the different posts, I just have to search path manually ans use Jay's answer (sorry for the bad formulation about 'which' which I understand, but I thought maybe there's something in os.path that does that though named strangely).