[GRASS-user] script by bash to Python

Glynn Clements glynn at gclements.plus.com
Tue Sep 23 15:04:54 EDT 2008


Gabriele N. wrote:

> >> I use grass63 with wxpython and I do not know how to use some scripts
> >> that I
> >> have in bash. The graphical interface opens but when I try to launch the
> >> script I get the following error:
> >> GRASS 6.3.0 (gb2):~ > v.topo_5
> >> $ v.topo_5 percorso=/home/gab/prova.shp nome_vett=foglio num=3
> >> campo=foglio
> >> Traceback (most recent call last):
> >>  File "/usr/lib/grass/etc/wxpython/gui_modules/menuform.py", line 763, in
> >> OnRun
> >>    self.goutput.RunCmd(cmd)
> >>  File "/usr/lib/grass/etc/wxpython/gui_modules/goutput.py", line 209, in
> >> RunCmd
> >>    generalCmd = subprocess.Popen(cmdlist,
> >> NameError: global name 'subprocess' is not defined
> >>
> >> If I run the script with grass -tcltk works well.
> > 
> > Upgrading to grass64 (devbr6) should fix it.
> 	
> I speak again of this post. With grass64 svn the situation has improved.
> Some scripts in bash run well and others do not.
> But I do not understand  what are the differences between a script that
> works and a script that does not work. I do not see the differences.

The above error is due to a bug in 6.3.0. The bug is only triggered
when running a command which isn't recognised as a GRASS command. 
Recognised commands are those corresponding to files in the bin,
scripts and etc/gui/scripts directories, with any .exe or .bat
extension removed.

It's also possible that individual scripts have bugs which are
specific to Windows. GRASS probably doesn't get a fraction of the
testing on Windows that it does on Linux and MacOSX.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list