Im having troubles saving the output into a specific file path like a csv file output just that my codes are simpler and it have 'with open(xxx)'.
So here are my codes. How do i print 'out' into a specific file path e.g /home/pi/Desktop/sample.json?
import csv
import json
with open(csvfile, "a") as output:
fieldnames = ['Name', 'Number', 'ID', 'Address']
writer = csv.writer(output,delimiter = ',', lineterminator="\n")
writer.writerows([fieldnames])