123456789101112131415161718192021222324252627282930313233 |
- import os
- import sys
- import json
-
- path = "C:/Users/danie/Documents/Projects/Companion App/server/Matricula Parse"
-
- dirsem = os.listdir(path)
-
-
- def orderFiles(files):
- i = 1
- for file in dirsem:
- if file.endswith('.json'):
- files.append({'file': file, 'num': i})
- i += 1
- return files
-
-
- files = orderFiles([])
-
-
- # for file in files3:
- # check = file['file'].split('.')
- # path = "C:/Users/diego/Documents/companion_app/segundo_sem" if check[0][-1] == '2' else "C:/Users/diego/Documents/companion_app/primer_sem"
- # with open(path + '/' + file['file']) as f:
- # data = json.load(f)
- # fac_id = file['num']
- # for key in data:
- # if key != 'Horario ':
- # code = key
- # name = data[key][0]
- # creds = data[key][1]
- # print(code, name, creds, fac_id)
|