[GRASSLIST:7208] Re: grass commands with python script

Stephan Holl holl at gdf-hannover.de
Fri Jun 17 09:42:53 EDT 2005


Hello orkun, 

On Thu, 16 Jun 2005 17:33:38 +0300 orkun <temiz at deprem.gov.tr> wrote:

> hello
> 
> I was wondering if it was possible to write grass commands
> in python script.
> 
> can you send me an example, link, doc ?

As my python knowledge is near to zero here an untested code-snippet:
<snippet>
cmds = [ 'd.mon stop=x6',
                 'g.region -d res=1',
                 'r.colors map=ortho col=grey',
                 'd.mon x6',
                 'd.mon sel=x6',
                 'd.rast ortho' ]
        for cmd in cmds:
                dlg.ShowModal()
                dlg.Destroy()
                return
</snippet>

Perhaps some python-gurus can provide better help...

Best
	Stephan
	
-- 
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office (TCH) -  Vahrenwalder Straße 7   -   D-30165 Hannover
Internet: www.gdf-hannover.de      -      Email: holl at gdf-hannover.de
Phone : ++49-(0)511-9357560       -          Fax: ++49-(0)511-9357100




More information about the grass-user mailing list