import re import sys sys.stdout.reconfigure(encoding='utf-8') with open('tools/test_convert_preview.py', 'r', encoding='utf-8') as fp: code = fp.read() target = "for p in ['trials/ultima_weapon.html'" exec(code[:code.find(target)]) with open('dungeons/index.html', 'r', encoding='utf-8') as fp: html = fp.read() res = build_html('dungeons/index.html', html) lines = res.splitlines() print('=== dungeons/index.html PREVIEW (最初の40行) ===') for l in lines[:40]: print(l) print('=== dungeons/index.html PREVIEW (最後の20行) ===') for l in lines[-20:]: print(l)