marmots/build_entity.py

12 lines
248 B
Python
Raw Normal View History

2011-03-19 00:10:02 +00:00
import re
reEnt = re.compile(r"^.*&#(\d+);.*$");
mpch_entity = [0]
with open("cp437_html.txt") as fp:
for line in fp.readlines():
ent = reEnt.match(line).group(1)
mpch_entity.append(int(ent))
print "mpch_entity = ", mpch_entity