[GRASS-user] Question about using \n in Grass.fatal

Glynn Clements glynn at gclements.plus.com
Fri Jul 15 03:19:41 EDT 2011


katrin eggert wrote:

> How can I have break lines (\n) in GRASS.FATAL in Python scripts? It seems
> not to be possible

Python understands C-style escapes:

	$ python
	Python 2.6.6 (r266:84292, Mar 20 2011, 07:54:33) 
	[GCC 4.3.4] on linux2
	Type "help", "copyright", "credits" or "license" for more information.
	> import grass.script as grass
	> grass.fatal('hello\nworld')
	ERROR: hello
	       world
	$ 

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


More information about the grass-user mailing list