[GRASS-dev] Re: A portible shell for GRASS 7+ ?
Glynn Clements
glynn at gclements.plus.com
Thu Jun 8 16:33:04 EDT 2006
David Finlayson wrote:
> I should add, that one of IPython's features is "autocall". This
> removes the need to use parethesis in function calls. What is cool
> about this is that we could write wrappers around the grass programs
> as functions and within IPython, the syntax of calling the functions
> would be virtually identical with the current documentation:
>
> For example:
>
> class general:
> def list(type, mapset):
> print os.popen('g.list type=%, mapset=%' % (type, mapset))
You don't want to be using a popen()-style interface which takes an
entire command as a string and uses the shell to decompose it, but
something which takes a list of arguments. Using the shell is a
nuisance if any of the arguments need to contain spaces or shell
metacharacters.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list