[GRASS-user] Problems with GRASS python code in osgeo4w

Glynn Clements glynn at gclements.plus.com
Mon Jul 13 18:36:49 EDT 2009

Moskovitz, Bob wrote:

> > Okay, so Python is working fine.
> If python is working, can you explain why my first example
> ( C:\Temp\printargs.py this is a test ) only prints out sys.argv[0]
> ?

Sorry, I overlooked that one.

> I believe that my problem has nothing to do with g.parser. I
> believe that the arguments to a python script are being stripped
> when you rely on ftype.

Okay; I think I know what's going on.

It appears that assoc and ftype set the registry keys:


[or py_auto_file, if that's what you use.]

The shell uses:


which are "virtual" keys which refer to either:


or the above HKLM keys, with the HKCU versions taking precedence. So
you can't use assoc/ftype to change the file associations if the HKCU
keys exist.

The confusion arose because both sets of keys were set to exactly the
same thing on my system.

FWIW, you do need the %* at the end of the command. If I remove that
from the HKCU keys, the arguments cease to be passed.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list