I would like to create a new .json file in a different path than the python file is written in. My code is listed below and does not work.
import json
file_name = r'.\Data\Archive-' + str(dt.datetime.now().strftime("%a-%m/%d/%y-%I%p")) + '.json'
file = open(file_name, 'w')
file.dump({})
The error:
FileNotFoundError: [Errno 2] No such file or directory