Compare commits
2 commits
053ff7dc06
...
f979c44a3b
| Author | SHA1 | Date | |
|---|---|---|---|
| f979c44a3b | |||
| 0ab67b9864 |
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Extracts description from datalist
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
|
@ -9,8 +13,9 @@ root = tree.getroot()
|
|||
|
||||
for game in root.findall("game"):
|
||||
romName = game.find("rom").get("name")
|
||||
print(romName)
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue