>
> I don't know in advance what the file name will be...

import re
for line in myfile:
    if re.search(r'\', line):
        line = line.replace('\\', '\\\\')

if you have lines that contain a \ in them that you don't want to substitute
then you need another if statement.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to