feat: first commit
This commit is contained in:
commit
b90bd077d9
24 changed files with 935 additions and 0 deletions
16
extract_romset.py
Executable file
16
extract_romset.py
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
tree = ET.parse(rf"{sys.argv[1]}")
|
||||
root = tree.getroot()
|
||||
|
||||
for game in root.findall("game"):
|
||||
romName = game.find("rom").get("name")
|
||||
textFile = os.path.splitext(f"{romName}")[0] + ".txt"
|
||||
os.makedirs("text", exist_ok=True)
|
||||
|
||||
with open(f"text/{textFile}", "w") as f:
|
||||
f.write(game.find("description").text)
|
||||
Loading…
Add table
Add a link
Reference in a new issue