I have a python file demo.py, I have created a JSON file using the demo.py file.
def write_json(new_data, filename='Report.JSON'):
with open(filename, 'w') as f:
json_string=json.dumps(new_data)
f.write(json_string)
This is creating a JSON file in the same directory in which the demo.py is present. If I want to save this report.json file into some other directory, how can I do that
Thanks in advance.
with open(f'{target_path}{filename}', 'w') as f: