Preface: do automated method commonly used in public
JSON Import
class ReadJson ():
DEF the __init __ (Self):
self.data self.read_data = ()
# JSON data read
DEF read_data (Self):
with Open ( '... path') AS FP:
Data = JSON. Load (FP)
return data
# key data acquired in accordance with
DEF get_Data (Self, ID):
return self.data [ID]
IF the __name__ == '__main__':
A = ReadJson ()
B = a.get_data (XX)
Print ( b)