Skip to content

Instantly share code, notes, and snippets.

@zach-morris
Last active May 28, 2021 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zach-morris/196ab188bbb04b3e076e4df8f98260c3 to your computer and use it in GitHub Desktop.
Save zach-morris/196ab188bbb04b3e076e4df8f98260c3 to your computer and use it in GitHub Desktop.
Creates dummy files for use with MAME software lists that can play games using them
# Creates dummy files for use with MAME software lists that can play games using them with python. Quick and dirty
# As described here: https://forums.libretro.com/t/guide-play-non-arcade-systems-with-mame-or-mess/17728/
# Using pathlib and xmltodict https://pypi.org/project/xmltodict/
from pathlib import Path
import xmltodict
import requests
folder = Path('.../neocdz/') #Path to where the dummy files should be generated
with requests.get('https://raw.githubusercontent.com/mamedev/mame/master/hash/neocd.xml') as url: #Update url as required
games = [x.get('@name') for x in xmltodict.parse(url.content).get('softwarelist').get('software') if x.get('@name')]
for gg in games:
folder.joinpath(gg+'.zip').write_text('') #Write dummy file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment