open json file in current directory python

Solutions on MaxInterview for open json file in current directory python by the best coders in the world

showing results for - "open json file in current directory python"
Arianna
26 Nov 2016
1import os
2script_dir = os.path.dirname(__file__)
3file_path = os.path.join(script_dir, 'relative/path/to/file.json')
4with open(file_path, 'r') as fi:
5    pass