Pietro wrote: > {{{ > import os > os.system('g.region rast=elevation') > }}} > > and not subprocess: > > {{{ > import subprocess > subprocess.call('g.region rast=elevation', shell=True) > > # or > > subprocess.Popen('g.region rast=elevation', shell=True) > }}} > > Concerning the pygrass Module API, may be we can use the shortcut version:
Using subprocess.call() with shell=True is no better than using os.system(). Both should be avoided at all costs. The grass.script module provides a number of convenience functions which use grass.script.make_command() to generate the command's argument list from the function's argument list. Also, they use a version of subprocess.Popen() which has been wrapped to deal with some of Windows' idiosyncrasies. -- Glynn Clements <gl...@gclements.plus.com> _______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev