Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import json
  2.  
  3. file_contents = []
  4.  
  5. class temprange:
  6. def __init__(self, key, value):
  7. self.key = key
  8. self.value = value
  9.  
  10. def readRJf():
  11. readFile = open("config.json", "r")
  12. contents = readFile.read()
  13.  
  14. data = json.loads(contents)
  15.  
  16. for key, values in data.items():
  17. file_contents.append( temprange(key, values) ) #storing updated file contents
  18.  
  19. for obj in file_contents:
  20. print( obj.value, obj.key, sep = ' ')
  21.  
  22. readRJf()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement