Hi again Alassane!

On Wed, Jun 1, 2016 at 7:41 PM, alassane toure <[email protected]> wrote:

> alassane@alassane-MS-7593:~/Programs/grass/pythongrass$
> /home/alassane/Programs/grass/pythongrass/grass_noloc.py
>   File "/home/alassane/Programs/grass/pythongrass/grass_noloc.py", line 62
>     else:
>        ^
> SyntaxError: invalid syntax
>
> The program works when I comment the followings statements
>
> #  define GRASS DATABASE
> if sys.platform.startswith('win'):
>     gisdb = os.path.join(os.getenv('APPDATA', 'grassdata')
> else:
>


>From looking at the code, it seems that the closing parentheses is missing
in the os.getenv() function call.

I'm not sure which code you are using and also where your data actually
are. APPDATA is not common for grassdata directory but should work of
course if it is what you want. Anyway, this is what the documentation [1]
suggests:

gisdb = os.path.join(os.path.expanduser("~"), "grassdata")

(and usually modifying for MS Windows with `os.path.expanduser("~"),
,"Documents", "grassdata"`.

Hope this helps,
Vaclav

PS: Please note you have [email protected] mailing list in
your To field. I don't think you want that (I'm not sure what would be the
reason). You can of course subscribe to [email protected] if you
want to discuss some development of GRASS GIS!

[1]
https://grass.osgeo.org/grass70/manuals/libpython/script.html#module-script.setup
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to