Hi list<br>I&#39;m trying to call r.stats grasstools from a python plugin<br>( doing a r.stats -1gn automatically in fact)<br>this python code is based on qgsgrassmodule.cpp, wich is used to launch grasstools in QGIS.<br>I get the grass environment by opening a mapset manually before running the python code.<br>
Then i&#39;m using a QProcess and appending the flag and options.<br>Got NO ERRORS in python console, but the output file isn&#39;t created.<br>May be there&#39;s a problem with args in the last line ??<br>Is there a python developer in the place ?<br>
<br>--------------------------------------------------------------------------------------------------<br>&nbsp;&nbsp;&nbsp; arg=[&#39;C:\Program Files\Quantum GIS\grass\bin\r.stats.exe&#39;];<br>&nbsp;&nbsp;&nbsp; process = QProcess()<br>&nbsp;&nbsp;&nbsp; env = process.systemEnvironment()<br>
&nbsp;&nbsp;&nbsp; env.append(&quot;GIS_FLAG_1=1&quot;)<br>&nbsp;&nbsp;&nbsp; env.append(&quot;GIS_FLAG_G=1&quot;)<br>&nbsp;&nbsp;&nbsp; env.append(&quot;GIS_FLAG_N=1&quot;)<br>&nbsp;&nbsp;&nbsp; env.append(&quot;GIS_OPT_INPUT=input=mnt10m&quot;)<br>&nbsp;&nbsp;&nbsp; env.append(&quot;GIS_OPT_OUTPUT=output=C:\testxyz&quot;)<br>
&nbsp;&nbsp;&nbsp; env.append(&quot;GIS_OPT_FS=fs=;&quot;)<br>&nbsp;&nbsp;&nbsp; arg.append(&quot;@ARGS_PARSED@&quot;)<br>&nbsp;&nbsp;&nbsp; process.setEnvironment(env)<br>&nbsp;&nbsp;&nbsp; process.start(arg[0],arg)<br>--------------------------------------------------------------------------------------------------<br>
Any Ideas ?<br>Thanks 4 any hints<br><br><span style="font-weight: bold;">PikOBoZ</span><br><br>