[GRASS-user] running grass commands in external IDE

Vaclav Petras wenzeslaus at gmail.com
Sat Jul 26 17:57:51 PDT 2014


On Fri, Jul 25, 2014 at 1:29 PM, Chad Ferguson <terrafergus at gmail.com>
wrote:

> sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "python",
> "grass", "script"))
>
> import grass.script as grass
>

Since the import is `import grass` or similar, you have to add the
directory containing `grass` directory, i.e.:

sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "python"))

By the way, my personal opinion is that

import grass.script as grass

is a bad practice and should be avoided in a new code, the alternative is
not standardized but

import grass.script as gscript

should do.

Vaclav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140726/81c2ea07/attachment.html>


More information about the grass-user mailing list