[GRASS-dev] grass and python

Michael Barton michael.barton at asu.edu
Mon Aug 14 01:54:28 EDT 2006


Look at the Python cmd module for this.

Michael
__________________________________________
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




From: David Finlayson <david.p.finlayson at gmail.com>
Date: Sun, 13 Aug 2006 21:39:33 -0700
To: Glynn Clements <glynn at gclements.plus.com>
Cc: Trevor Wiens <twiens at interbaun.com>, Michael Barton
<michael.barton at asu.edu>, <grass-dev at grass.itc.it>, <William at grass.itc.it>,
Kyngesburye <kyngchaos at kyngchaos.com>, <woklist at kyngchaos.com>
Subject: Re: [GRASS-dev] grass and python

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.popen
call. 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
<mailto: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 <http://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/82e48fe6/attachment.html


More information about the grass-dev mailing list