From 0ab67b9864507243bb2a702094b5d8268519395f Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Sun, 21 Dec 2025 09:27:10 +0100 Subject: [PATCH] feat: add docstring, specific encoding. --- extract_romset.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extract_romset.py b/extract_romset.py index 0d8aa09..f116c53 100755 --- a/extract_romset.py +++ b/extract_romset.py @@ -1,5 +1,9 @@ #!/usr/bin/env python +""" +Extracts description from datalist +""" + import os import sys import xml.etree.ElementTree as ET @@ -12,5 +16,5 @@ for game in root.findall("game"): textFile = os.path.splitext(f"{romName}")[0] + ".txt" os.makedirs("text", exist_ok=True) - with open(f"text/{textFile}", "w") as f: + with open(f"text/{textFile}", "w", encoding="utf-8") as f: f.write(game.find("description").text)