<div dir="ltr"><div>This initiates the grass gis and will be running background. </div>subprocess.Popen(['cmd','/K','grass72 -text'],cwd=gisbase)<div><br></div><div>However, the d.mon does not open even after executing <br></div><div>from grass.script.setup import set_gui_path<br></div><div>set_gui_path()</div><div><br></div><div>Am I still missing something?</div><div><br></div><div>I also tried running by directly injecting 'd.mon start=wx1' command to the subprocess itself. With this approach I got an error as stated in ##ERROR (as shown in attachement_2)</div><div>subprocess.Popen(['cmd','/K','grass72 -text','<b>d.mon start=wx1</b>'],cwd=gisbase)<br></div><div><br></div><div>##ERROR: Cleaning up temporary files...</div><div>Starting GRASS GIS...</div><div>ERROR: <C:\Users\WRPPF-A> is not a valid GRASS Location because PERMANENT Mapset is missing</div><div>Exiting...</div><div>Press any key to continue . . .</div><div><br></div><div>I have attached the my script herewith this mail.</div><div>Will be looking forward to hearing from you.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:12.8px"><b>Regards,</b></div><div style="font-size:12.8px"><b>Ang Dawa Sherpa</b></div><div style="font-size:12.8px"><b>GIS technician - Irrigation Master Plan</b></div><div style="font-size:12.8px"><b>WRPPF - DOI, Nepal Government</b></div><div style="font-size:12.8px"><b>Lalitpur</b></div><div style="font-size:12.8px"><b>contact: 984 007 3861</b></div></div></div></div>
<br><div class="gmail_quote">On Sun, Jan 8, 2017 at 6:13 PM, Martin Landa <span dir="ltr"><<a href="mailto:landa.martin@gmail.com" target="_blank">landa.martin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
2017-01-08 11:06 GMT+01:00 Ang Sherpa <<a href="mailto:angsherpa232@gmail.com">angsherpa232@gmail.com</a>>:<br>
> However, still no changes, the [d.*] doesnot starts. Am I missing something?<br>
> I have attached the script herewith this mail.<br>
<br>
<br>
</span>see my last replay:<br>
<span class=""><br>
"""<br>
interactive monitors require running GRASS. It is probably reason why<br>
wx monitor is not even launched since your script already terminates<br>
(and GRASS session too). It has no reason to use interactive monitors<br>
outside of GRASS. If you modify your script like:<br>
<br>
gscript.run_command('d.mon', stop='wx6') # we asssume that there is<br>
already monitors hanging from last run<br>
gscript.run_command('d.mon',<wbr>start='wx6',resolution='1')<br>
time.sleep(2)<br>
gscript.run_command('d.rast',<wbr>map='elevation')<br>
time.sleep(200)<br>
os.remove(rcfile)<br>
<br>
Then monitor shows and will running 200sec. But it has no sense. So I<br>
suggest you to use:<br>
<br>
1) file-based monitors (which is natural for script, generate<br>
something, render to file and close)<br>
<br>
script.run_command('d.mon',<wbr>start='cairo',resolution='1',<br>
output="/path/image.png")<br>
# no need to sleep<br>
gscript.run_command('d.rast',<wbr>map='elevation')<br>
gscript.run_command('d.mon', stop='cairo')<br>
<br>
or<br>
<br>
2) launch your script from running GRASS<br>
"""<br>
<br>
</span>Result: when using interactive monitors you need to have active GRASS<br>
session running on background. Ma<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Martin Landa<br>
<a href="http://geo.fsv.cvut.cz/gwiki/Landa" rel="noreferrer" target="_blank">http://geo.fsv.cvut.cz/gwiki/<wbr>Landa</a><br>
<a href="http://gismentors.cz/mentors/landa" rel="noreferrer" target="_blank">http://gismentors.cz/mentors/<wbr>landa</a><br>
</div></div></blockquote></div><br></div>