Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import os, sys
- import glob
- stext = sys.argv[1]
- rtext = sys.argv[2]
- path = sys.argv[3]
- input = sys.stdin
- output = sys.stdout
- files = glob.glob(path)
- for file in files:
- input = open(file)
- output = open(file + '_copy', 'w')
- for s in input.xreadlines( ):
- output.write(s.replace(stext, rtext))
- output.close( )
- input.close( )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement