creatJsonProfile.py 365 Bytes
Newer Older
李维's avatar
李维 committed
1 2 3 4 5 6 7 8 9 10 11 12 13
import os
import json
def file_name(file_dir):
  fileList =[]
  for root, dirs, files in os.walk(file_dir):
    fileList = files
  return fileList
fileList = file_name(os.path.abspath('.'))
f = open('filename.txt', 'w')
for fn in fileList:
  if fn.split(".")[0] != "creatJsonProfile":
    f.write("'" + fn.split(".")[0] + "': 'assets/play/" + fn + "',\n")
f.close()