import json
import glob
import os

listOfFiles = glob.glob(f'{os.getcwd()}/*.json')
latestFile = max(listOfFiles, key=os.path.getctime)

with open(latestFile, 'r') as jsonFile:
    data = json.load(jsonFile)
    for item in data:
        print(item)

listOfFiles.remove(latestFile)

if len(listOfFiles) > 2:
    for files in listOfFiles:
        os.remove(files)
