Luisa Peña wrote: > is there any difference, when it comes to processing, between run_command > and read_command?
run_command() executes the command and waits for it to terminate; it doesn't redirect any of the standard streams. read_command() executes the command with stdout redirected to a pipe, and reads everything written to it. Once the command terminates, it returns the data written to stdout as a string. > and from read_command can I retrieve the error also? None of the existing *_command functions redirect stderr. You can do so with e.g.: def read2_command(*args, **kwargs): kwargs['stdout'] = grass.PIPE kwargs['stderr'] = grass.PIPE ps = grass.start_command(*args, **kwargs) return ps.communicate() This behaves like read_command() except that it returns a tuple of (stdout,stderr) rather than just stdout. -- Glynn Clements <gl...@gclements.plus.com> _______________________________________________ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user