Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat ~/scripts/strip_html.py
- #!/usr/bin/python
- # coding=utf-8
- # -*- encoding: utf-8 -*-
- import sys, codecs, copy, commands;
- sys.stdin = codecs.getreader('utf-8')(sys.stdin);
- sys.stdout = codecs.getwriter('utf-8')(sys.stdout);
- sys.stderr = codecs.getwriter('utf-8')(sys.stderr);
- c = sys.stdin.read(1);
- printo = True;
- while c: #{
- if c == '<': #{
- printo = False;
- c = sys.stdin.read(1);
- continue;
- elif c == '>': #{
- printo = True;
- c = sys.stdin.read(1);
- continue;
- #}
- if printo == True: #{
- sys.stdout.write(c);
- #}
- c = sys.stdin.read(1);
- #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement