[GRASS-dev] Re: [GRASS-user] Error when importing data in Windows with Python Script

Luis Lisboa luislisboa1975 at gmail.com
Mon Oct 18 06:30:16 EDT 2010


Hello Glynn

About this, What can i do to fix this? Or isn't anything I can do?
Thanks
Luis

On Fri, Oct 15, 2010 at 6:08 PM, Glynn Clements <glynn at gclements.plus.com>wrote:

>
> [CC to grass-dev]
>
> Luis Lisboa wrote:
>
> > > > I'm running a Python script in WinGRASS6.4 but when I insert as the
> input
> > > > C:\Data\L5216065_06520070405_B70.TIF
> > > >
> > > > inside Python Script, the input is:
> > > > C:DataL5216065_06520070405_B10.TIF
> > > >
> > > > I realized that, if I, by-hand, i change the \ by / it runs ok.
> > > >
> > > > is it possible to have an automatic process to change this instead of
> > > having
> > > > the users doing this by-hand?
> > >
> > > How are you running the script? If you run it via bash, any
> > > backslashes will be interpreted before the script is executed. There
> > > isn't anything the script can do about this.
> >
> > I'm running via WxGUI's modules. I use the browse button to find the file
> > and it automatically places the path tot the file. Is this via Bash?
>
> No, but wxGUI's "command prompt" is using shlex.split(), which mimics
> a typical Unix shell:
>
>        >>> shlex.split(r'C:\Data\L5216065_06520070405_B70.TIF')
>        ['C:DataL5216065_06520070405_B70.TIF']
>
> I suspect that it should have "posix = False" on Windows:
>
>        >>> shlex.split(r'C:\Data\L5216065_06520070405_B70.TIF', posix =
> False)
>        ['C:\\Data\\L5216065_06520070405_B70.TIF']
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20101018/065e705b/attachment.html


More information about the grass-dev mailing list