From ggrothendieck at gmail.com  Sat Jun 27 18:01:34 2009
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Sat, 27 Jun 2009 12:01:34 -0400
Subject: [Rd] Robust, platform independent method to check for python
In-Reply-To: <1246117479.4926.11.camel@kropotkin>
References: <1246117479.4926.11.camel@kropotkin>
Message-ID: <971536df0906270901u64551ccco8dfc6ca59056f511@mail.gmail.com>

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
>



[Rd] Robust, platform independent method to check for python
Gabor Grothendieck