in sample/main.py [0:0]
def get_file_content(file_name: str):
"""
Get the content of JSON file.
"""
if file_name != "" and not os.path.exists(file_name):
print("\tFile", file_name, "for index mappings/settings does not exist. Program will end.")
exit(0)
if file_name != "":
file = open(file_name)
content = json.load(file)
file.close()
else:
content = {}
return content