Hi all I know this is not numpy related but a colleague insists the following is supposed to work. But it doesn't:
== line_left = './erfo/restart.ST010.EN0001-EN0090.YYYYMMDDhh' enafix = 'ST000.EN0001-EN0092' line_left = line_left.replace('STYYY.ENXXXX-ENXXXX', enafix) print 'line_left',line_left == [right answer would be: ./erfo/restart.ST000.EN0001-EN0092.YYYYMMDDhh' ] I think it works in Fortran but not in Python. What would be the easiest way to replacing this kind of pattern in a variable lenght string? Thanks, Siegfried -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion