[GRASS-dev] grass and python

David Finlayson david.p.finlayson at gmail.com
Mon Aug 14 00:39:33 EDT 2006


The Python interpreter is interactive, but it is not a general purpose
shell. You would need to wrap external programs in an os.system or
os.popencall. One attractive way of getting around this is to pre-wrap
each program
in a python object. For example:

class Display:

    def rast(self, rastername):



On 8/12/06, Glynn Clements <glynn at gclements.plus.com> wrote:
>
>
> Trevor Wiens wrote:
>
> > > If anyone can find a real language which is "good enough" on all of
> > > Unix, Windows (Cygwin and native) and OSX, I'll quite happily rewrite
> > > all of GRASS' shell scripts.
> >
> > Python is easy to install on Windows. So with an offer like that, I
> > can't help asking if any of the interactive Python shells are to your
> > knowledge good enough. Or perhaps what in you mind defines an
> > interactive shell environment that is good enough to replace bash?
>
> The main issue is the ability to have scripts which can be run as e.g.
> "d.save", and not having to use "d.save.py". This needs to work both
> from a shell and from system/exec/popen/spawn/etc functions provided
> by various languages.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>



-- 
David Finlayson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20060813/617e1f04/attachment.html


More information about the grass-dev mailing list