blob: a4cfd1eb10a5ffc2313a9b605c8954c8862950a7 (
plain) (
tree)
|
|
monster_db = {}
def read_monster_db(file='db/monsterdb.txt'):
with open(file) as f:
for l in f.readlines():
try:
index = l.index(' ')
monster_id = int(l[:index])
monster_name = l[index + 1:-1]
monster_db[monster_id] = monster_name
except ValueError:
pass
return monster_db
|