[R] PythonInR. Python script in R with parameters required. Download satellite images from NASA

Magi Franquesa magifranquesa at gmail.com
Wed Jul 29 18:29:24 CEST 2015


Hello,

I'm trying to execute a python script within R (3.2.1 x 64) with the
PythonInR package. I would like to download an order of satellite images
from Nasa using a python script (
http://landsat.usgs.gov/documents/espa_bulk_downloader_v1.0.0.zip) but I
have no success. I first run the pyExecfile command with the *feedparser.py*
script and then the *download_espa_order.py* giving the required parameters
(my mail acount and the order number), here is the code:

setwd("C:/Python27")
install.packages("PythonInR")
library(PythonInR)
pyConnect(pythonExePath="C:/Python27/python.exe")
pyIsConnected()
# autodetectPython("C:/Python27/python.exe")

pyExecfile("C:/Landsat/feedparser.py")
pyExecfile("C:/Landsat/download_espa_order.py" -e "magifranquesa en gmail.com"
-o "magifranquesa en gmail.com-07222015-120911" -d "C:/Landsat/ESPA")

and I get this error:

Error: unexpected string constant in
"pyExecfile("C:/Landsat/download_espa_order.py" -e
"magifranquesa en gmail.com""

The code "C:/Landsat/download_espa_order.py" -e
"magifranquesa en gmail.com" -o "magifranquesa en gmail.com-07222015-120911"
-d "C:/Landsat/ESPA" runs ok when I use it within
system console.

I appreciate if someone could help me to solve this problem.

Thank you

	[[alternative HTML version deleted]]



More information about the R-help mailing list