# This file is part of MarMOTS. # # MarMOTS is free software: you can redistribute it and/or modify it under the terms of the GNU Affero # General Public License as published by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # MarMOTS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General # Public License for more details. # # You should have received a copy of the GNU Affero General Public License along with MarMOTS. If not, # see . # # Copyright 2009, 2010, 2011, 2020 Jeremy Penner 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