We are writing a script with the simple Python editor (GRASS GIS). We try to set the rules for a reclass command within the script (without creating a txt.file manually).

Is it possible to set the rules within the script or is it possible to create a txt.file with the simple Python editor?

  • Have you tried using Python functions to write your text file? This sounds like something you should research at Stack Overflow rather than ask here.
    – PolyGeo
    Jan 10, 2020 at 19:40

1 Answer 1


You can take a look at existing Python code in the main GRASS GIS repository, for example here:


Here, the output of one command is used to generate the rules file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.