Skip to content
Prev 33126 / 63421 Next

Robust, platform independent method to check for python

If you can assume its on your path then try this:

pth <- sapply(strsplit(Sys.getenv("PATH"), ";"), function(x)
file.path(x, "python.exe", fsep = "\\"))
pth[file.exists(pth)][1]

On Sat, Jun 27, 2009 at 11:44 AM, Carlos J. Gil
Bellosta<cgb at datanalytics.com> wrote: