Hi Martin. The 'for x in *' is looping through files in the current working directory. In the full code listing, you might notice that I have used a small shortcut-- I give the GRASS rasters the same names as the input files. In order to directly list GRASS layers, you need to use the command 'g.list' or 'g.mlist' -- these can return a list that can be iterated over with a for loop.
for loop
Hi Martin. The 'for x in *' is looping through files in the current working directory. In the full code listing, you might notice that I have used a small shortcut-- I give the GRASS rasters the same names as the input files. In order to directly list GRASS layers, you need to use the command 'g.list' or 'g.mlist' -- these can return a list that can be iterated over with a for loop.