[GRASSGUI] python scripting support?

Jachym Cepicky jachym.cepicky at gmail.com
Tue Apr 10 06:35:19 EDT 2007


thanks, glynn, I'll try to update

j

2007/4/10, Glynn Clements <glynn at gclements.plus.com>:
>
> Jachym Cepicky wrote:
>
> > > >> Any idea what would be the python equivalent of the bash lines...
> > > >>
> > > >> if [ "$1" != "@ARGS_PARSED@" ] ; then
> > > >>   exec g.parser "$0" "$@"
> > > >> fi
> > > >
> > > > AFAICT:
> > > >
> > > > if ( sys.argv[1] != "@ARGS_PARSED@" ):
> > > > os.execv("g.parser", [sys.argv[0]] + sys.argv)
> >
> > g.manual g.parser ;-)
>
> The example given in the manual page is less than ideal, e.g. using
> os.system() instead of os.execv(). This will fail if any of the
> arguments contain spaces or other shell metacharacters.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>


-- 
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub




More information about the grass-gui mailing list