creatJsonProfile.py 455 Bytes
import os
import json
def file_name(file_dir):
  fileList =[]
  f = open('filename.txt', 'w')
  for root, dirs, files in os.walk(file_dir):
    for fileName in files:
      if root.split("\\")[-1]=="frame" or root.split("\\")[-1]=="sound" or root.split("\\")[-1]=="play":
       f.write("'" + fileName.split(".")[0] + "': 'assets/" + root.split("\\")[-1] + "/" + fileName + "',\n")
    f.write("\n")
  f.close()
fileList = file_name(os.path.abspath('.'))