Created
August 13, 2012 01:27
-
-
Save npow/3336218 to your computer and use it in GitHub Desktop.
Python sed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: latin1 -*- | |
import os | |
import sys | |
import re | |
FILENAME = sys.argv[1] | |
def main(): | |
f = open(FILENAME) | |
contents = '' | |
for line in f: | |
line = line.replace('', '') | |
line = line.replace('document.createElement("CANVAS")', 'new TRWebchart_Shared.SharedUtilityFuncs().createCanvas()'); | |
contents += line | |
f.close() | |
f = open(FILENAME, 'w') | |
f.write(contents) | |
f.close() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment