#!/usr/bin/env python #Reverses the actions of bobby.py #example usage: unbobby.py *.html #Note that this script does not use compiled regular expressions. from sys import * import re for file in argv[1:]: print file #print name of file that is being modified infile=open(file) all=infile.readlines() #put the lines of the file into a list infile.close() outfile=open(file,'w') #reopen the file for writing for line in all: line=re.sub(' alt="pix"','',line)# replace all ' alt="pix"' with nothing outfile.write(line) #write the line to the file outfile.close() #close the file after inspecting and modifying all lines