Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created October 12, 2012 14:54
Show Gist options
  • Select an option

  • Save EdwardIII/3879595 to your computer and use it in GitHub Desktop.

Select an option

Save EdwardIII/3879595 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from bs4 import BeautifulSoup
import fnmatch
import os
import re
replacement_file = open('/tmp/t.txt', 'r')
for root, dirnames, filenames in os.walk('.'):
for filename in fnmatch.filter(filenames, '*.html'):
f = open(os.path.join(root, filename), 'r+')
print "Replacing %s/%s" % (root, filename)
f.write(f.read())
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment