[GRASS-user] Python script in grass

Glynn Clements glynn at gclements.plus.com
Sat Feb 6 13:06:19 EST 2010


Margherita Di Leo wrote:

> please a little help with my python script. I don't know how to say in 
> python:
> 
> echo "589541.859564|4473239.49338|9999" | v.in.ascii output=outlet

To do it using the grass.script module:

	grass.write_command('v.in.ascii', output = 'outlet',
	                    stdin = "589541.859564|4473239.49338|9999")

or (more suitable when you want to feed a lot of data):

	p = grass.feed_command('v.in.ascii', output = 'outlet')
	p.stdin.write("589541.859564|4473239.49338|9999")
	p.stdin.close()
	p.wait()

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list