[GRASS-user] batch job

Carmine Massarelli carmine.massarelli at ba.irsa.cnr.it
Thu Mar 16 08:53:54 PDT 2017


Dear,
I have prepared a couple of scripts to execute a batch job: the first 
opens a csv file and formats the data for the second (invoked from the 
first) that include some grass functionality.
The second script uses grass functionality without starting grass 
explicitly.
If I execute the first script from shell all it is working, but if i 
invoke it from a php button (shell_exec('python path/script.py')) I 
receive the error: /Cannot find GRASS GIS 7 start script (['grass72', 
'--config', 'path'])/
I saw that it is related to subprocess (here the code):

/p = subprocess.Popen(startcmd, shell=False,stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)//
//out, err = p.communicate()//
//if p.returncode != 0://
//    print >>sys.stderr, "ERROR: Cannot find GRASS GIS 7 start script 
(%s)" % startcmd//
//    sys.exit(-1)//
//gisbase = out.strip('\n\r')/

but I am not expert about this, so I ask for your help.
What could I do?
I have already set sudoers   www-data ALL=NOPASSWD: ALL   and checked 
permission.
Thanks in advance

carmine

-------------- parte successiva --------------
Un allegato HTML รจ stato rimosso...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170316/4257b4e7/attachment.html>


More information about the grass-user mailing list