Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (17 sloc) 0.445 kB
#!/usr/bin/env python
import utils, sys
def strip_tags(filename):
string = open(filename, encoding='utf-8').read()
d = 0
out = []
for c in string:
if c == '<': d += 1
if d > 0:
out += ' '
else:
out += c
if c == '>': d -= 1
print(''.join(out))
for f in sys.argv[1:]:
t = utils.benchmark(lambda: strip_tags(f))
sys.stderr.write('{0}: {1}\n'.format(f, t))
Jump to Line
Something went wrong with that request. Please try again.