import json def export_json(data): path = "/tmp/results.json" with open(path, "w") as f: json.dump(data, f, indent=2) return path