[GRASSGUI] Re: [grass-addons] r509 - trunk/grassaddons/gui/gui_modules

Martin Landa landa.martin at gmail.com
Mon Apr 16 08:35:27 EDT 2007


Hi,

2007/4/16, Michael Barton <michael.barton at asu.edu>:

> Should we start going through and switching instances of os.system to
> os.execvp? What is the correct syntax for something like this...
>
> vcmd = "v.what -a map=%s east_north=%f,%f distance=%f" % \
> (vectstr, float(x), float(y), qdist)
>
> os.system(vcmd)
>
> Is it...?
>
> vcmd = ['v.what', '-a', 'map='+vectstr, 'east_north=%f,%f' % ( float(x),
> float(y)), 'distance='+qdist]
>
> os.execvp(vcmd)
>
> What about os.popen and Popen?
>
> Finally, how do we return the properly built command from buildCmd to put
> into os.execvp?

Please take look at cmd package.

Martin

>
> thanks
>
> Michael
>
>
> On 4/15/07 11:00 PM, "calvelo at grass.itc.it" <calvelo at grass.itc.it> wrote:
>
> > Log:
> > - better test task: use with 'test' as the grass command
> > - now cmdPanel may be queried by (i) buildCmd, which returns an array of
> > arguments and (ii) createCmd, which is the usual cmdline string. This allows
> > for both system-style use (with the usual quote madness), and a saner
> > execve-style command launch.
>
> __________________________________________
> Michael Barton, Professor of Anthropology
> School of Human Evolution & Social Change
> Center for Social Dynamics & Complexity
> Arizona State University
>
> phone: 480-965-6213
> fax: 480-965-7671
> www: http://www.public.asu.edu/~cmbarton
>
>
> _______________________________________________
> grassgui mailing list
> grassgui at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grassgui
>


-- 
Martin Landa <landa.martin at gmail.com> * http://gama.fsv.cvut.cz/~landa *




More information about the grass-gui mailing list