Page MenuHomePhabricator

chr.wiki.py

Authored By
bzimport
Nov 21 2014, 8:48 PM
Size
344 B
Referenced Files
None
Subscribers
None

chr.wiki.py

#!/usr/bin/env python3.0
import sys
import re
_input = [line for line in sys.stdin.readlines()]
_print = ""
_ws = re.compile("&#x.{2,4};")
_ws2 = re.compile("&#x|;")
def f_(mo):
_s1 = re.sub(_ws2,"",mo.group(0))
return chr(int(_s1,16))
for l in _input:
if _ws.search(l):
_print += re.sub(_ws,f_,l)
else:
_print += l
print(_print)

File Metadata

Mime Type
text/x-python
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1869
Default Alt Text
chr.wiki.py (344 B)

Event Timeline