[GRASS-dev] Re: [GRASSGUI] silly question - running a python script

Hamish hamish_nospam at yahoo.com
Sun Jun 10 23:30:08 EDT 2007


Glynn: 
> > Oh no:
> > 
> >     for arg in sys.argv:
> >         args += arg+" "


I have updated the g.parser help page Python example with the fixed args
usage, but I notice the Perl example there (6.3cvs version only) is
broken as well.

http://freegis.org/cgi-bin/viewcvs.cgi/grass6/general/g.parser/description.html

if( $ARGV[0] ne '@ARGS_PARSED@' ){
    my $arg = "";
    for (my $i=0; $i < @ARGV;$i++) {
        $arg .= " $ARGV[$i] ";
    }
    system("$ENV{GISBASE}/bin/g.parser $0 $arg");
    exit;
}


Also I notice a difference in the python version where main(): now ends
with "return". Does this matter?


Hamish




More information about the grass-dev mailing list