[GRASS-dev] python question

Christine geo.guide at web.de
Sat Jun 23 14:54:54 PDT 2012


Michael Barton wrote
> 
> 
> for i in flist:
> 	's%_new' % i = 10
> 
> where flist is a list of strings (e.g., file names)
> 
> 

Being not a programmer and also not sure, what you exactly want to do. But
AFAIK string replacement in Python should be coded '%s' instead of 's%'. 
And '%i' is actually reserved for the replacement of integers, but you are
about to use it as an iterator as well, isn't it? Would be interesting, if
this works nevertheless ...

Regards, Christine


--
View this message in context: http://osgeo-org.1560.n6.nabble.com/python-question-tp4983356p4983365.html
Sent from the Grass - Dev mailing list archive at Nabble.com.


More information about the grass-dev mailing list