[GRASS-user] [d.*] command not executing from standalone script

Vaclav Petras wenzeslaus at gmail.com
Mon Jan 9 06:20:00 PST 2017


On Mon, Jan 9, 2017 at 5:01 AM, Ang Sherpa <angsherpa232 at gmail.com> wrote:

> However, the d.mon does not open even after executing
> from grass.script.setup import set_gui_path
> set_gui_path()
>

This is not related to `d.mon wx1` (at least not directly). This is for
cases when you write your GUI using wxPython and GRASS' wxGUI. Kind of like
the following (which is actually d.mon wx* implementation) but simpler:

https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/mapdisp/main.py


>
> Am I still missing something?
>
> 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)
> subprocess.Popen(['cmd','/K','grass72 -text','*d.mon start=wx1*
> '],cwd=gisbase)
>

This is missing --exec parameters and is likely not appropriate together
with grass.script.setup.init().

However, the question is, why do you need it and what would you do with
that if it worked? Do you want to just show the data? Or do you want to
interact with the display? Get coordinates? Set computational region? Why
not running in the GRASS GIS and let user use standard ways of setting
computational region extent and resolution? Gives using `g.gui -f` instead
of `d.mon wx1` an acceptable result? (I probably need detailed answer to
each of those questions to understand what you are trying to achieve.)

Vaclav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170109/a17fce01/attachment.html>


More information about the grass-user mailing list