def getWorkers(url_workers) :
with open(url_workers, encoding='utf-8') as wor :
workers = json.load(wor)
workerd.append(workers['workers'])
return workerd
def Worker(url_workers, worker_name, worker_b_day, worker_tg_id) :
with open(url_workers, encoding='utf-8') as wor :
workers = json.load(wor)
for i in workers['workers'] :
if worker_name == i['name'] :
if worker_b_day != i['b_day'] :
i['b_day'] = worker_b_day
if worker_tg_id != i['tg_id'] :
i['tg_id'] = worker_tg_id
with open(url_workers, 'w', encoding='utf-8') as f :
json.dump(workers, f, indent=4, ensure_ascii=False)