RichardCooper wrote:

> with open('glist_llrotate.txt') as gl:
>     for line in gl:

> And the error: 
> WARNING: Illegal filename <cahpa.f1jan.05216.nc_remapped.nc.27
>          >. Character <
>          > not allowed.

When you iterate over a file, the strings include the line terminators
(e.g. '\n' or '\r\n'). Use e.g.

    for line in gl:
        renamed = line.rstrip().replace('.','_')
        ...

to remove any trailing whitespace (including newlines) from each line.

-- 
Glynn Clements <gl...@gclements.plus.com>
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to