Skip to content

Instantly share code, notes, and snippets.

@yafkari
Last active November 26, 2018 15:15
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 yafkari/9fd92c33e44dd19f10296d7190d6b277 to your computer and use it in GitHub Desktop.
Save yafkari/9fd92c33e44dd19f10296d7190d6b277 to your computer and use it in GitHub Desktop.
quick tool to list all the sounds found in the res folder for the bobot project
import os
for file in os.listdir("."):
if(file.split(".")[1] == ".mp3"):
text = "\"{}\": {{\n\t\"path\": \"./res/sounds/{}\"\n}},\n".format(file.split(".")[0], file)
with open('sounds.json', 'a+') as file:
file.write(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment