Xah Lee wrote:
suppose you want to do find & replace of string of all files in a
directory.
here's the code:
[snip]
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
When are you going to take the hint (from everybody in
comp.lang.perl.misc and comp.lang.python) to stop posting! Yo
suppose you want to do find & replace of string of all files in a
directory.
here's the code:
©# -*- coding: utf-8 -*-
©# Python
©
©import os,sys
©
©mydir= '/Users/t/web'
©
©findStr=''
©repStr=''
©
©def replaceStringInFile(findStr,repStr,filePath):
©"replaces all findStr by repStr in file file