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.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <div> <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.