how to load a json file if the directory contains a file name code example
Example: open json file in current directory python
import os
script_dir = os.path.dirname(__file__)
file_path = os.path.join(script_dir, 'relative/path/to/file.json')
with open(file_path, 'r') as fi:
pass