def load_data(): global school_data global students_data with open(location('data/school.json')) as f: school_data = json.load(f) with open(location('data/Students.json')) as f: students_data = json.load(f)
def load_data(): global school_data global students_data global teachers_data with open(location('data/school.json'), encoding='utf-8') as f: school_data = json.load(f) with open(location('data/Students.json'), encoding='utf-8') as f: students_data = json.load(f) with open(location('data/Teachers.json'), encoding='utf-8') as f: teachers_data = json.load(f)
def load_data(): global school_data global students_data global teachers_data with open(location("data_tasks_6/school.json")) as school_data: school_data = json.load(open(location("data_tasks_6/school.json"))) with open(location("data_tasks_6/Students.json")) as students_data: students_data = json.load(open(location("data_tasks_6/Students.json"))) with open(location("data_tasks_6/Teachers.json")) as teachers_data: teachers_data = json.load(open(location("data_tasks_6/Teachers.json")))
# к текущей школе и текущим класса (указанным в school.json) # 2. Сделайте функцию обертку, для удобного вывода цветного текста # 3. Разукрасьте текст программы, сделав его удобнее для восприятия import os import json from utilities import location, clear, get_full_name, search, main, info_menu, info_menu_class # Further Data people_list = [] choice = 0 class_room = 0 # Load Data with open(location('data/school.json')) as f: school_data = json.load(f) with open(location('data/Students.json')) as f: students_data = json.load(f) with open(location('data/Teachers.json')) as f: teachers_data = json.load(f) # MAIN clear() # Про цветной текст ищите в гугле main(school_data) # Главное меню
import json from utilities import location def get_full_name(student): return ' '.join([student['name'], student['middle_name'], student['surname']]) # load data with open(location('data/Students.json'), encoding='utf-8') as f: students_list = json.load(f) # get students full names students_list = list(map(lambda x: get_full_name(x), students_list)) # sort list by alphabetic students_list.sort() # print students for number, student in enumerate(students_list, start=1): print('%s) %s' % (number, student))