[GRASS-dev] parsing file paths in GRASS Scripts- Windows OS

Glynn Clements glynn at gclements.plus.com
Fri Mar 11 12:53:50 EST 2011


katrin eggert wrote:

> > > Everytime I try to run a Python Script in Windows, when I need to insert a
> > > file path (e.g. D:\testing_ground) I need to change the \ for /.
> >
> > In what context?
> 
> For instance imagine that I have a python script called r.landsat.py that
> imports landsat images and do some basic processing. In this case, Landsat
> file path must be with '/' instead of '\'. I know that it«s a simple thing
> but my bunch of colleagues (old people and used to "easy" tools) are
> complaining about this because we have built a script and we need to run it
> a couple of times. I know that the same thing happens with GRASS Bash
> Scripts.
> 
> 
> Yes, I have understand about the '\'.

>From what you have said, you don't appear to understand.

Python accepts '\'. GRASS typically just passes filenames to the OS,
and Windows accepts '\'.

If you're having problems with '\' in filenames, either you're using
bash (in which case, the solution is either to accept that you have to
conform to bash's syntax or don't use bash), or you've found a bug in
a specific module (in which case, you need to say which one).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list