updating load results
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,17 @@
|
||||
import json
|
||||
import glob
|
||||
import os
|
||||
|
||||
with open('/Users/dtomlinson/OneDrive - William Hill Organisation Limited'
|
||||
'/Mac/git_repos/python-VM/slack-bot/traffic-scraper/'
|
||||
'prd/12-10-2019_02:53:32.json', 'r') as jsonFile:
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user