Message-ID: <971536df0906270901u64551ccco8dfc6ca59056f511@mail.gmail.com>
Date: 2009-06-27T16:01:34Z
From: Gabor Grothendieck
Subject: Robust, platform independent method to check for python
In-Reply-To: <1246117479.4926.11.camel@kropotkin>
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:
> Hello,
>
> I have been unsuccessfully struggling for a programmatical method to
> find out whether and where Python is installed.
>
> The reason is that I am developing a package that depends on python.
>
> On UNIX/UNIX-like systems I can quite safely assume that python is
> directly callable via system if installed.
>
> My main problems is Windows, though...
>
> Has anybody faced this problem before?
>
> Best regards,
>
> Carlos J. Gil Bellosta
> http://www.datanalytics.com
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>