dict1 = {"retrievalid": "status", "retrieval":"status",}
import csv
dict2= {'DOB': '05/11/1961', 'DoctorLast': 'peter', 'PatientFirstname': 'ramasamy', 'DoctorFirst': 'kesava', 'PhNo': '734 535 343', 'PatientLastname': 'kum', 'Location': 'blr', 'retID': 'j233 1331', 'SiteId': '1234143', 'FaxNo': 'NULL', 'COMPLETED_DATE': '2015-02-13 09:06:27.000', 'retID_WH': 'f234343', 'STATUS': 'DELIVERED'
with open('karthik.csv', 'w') as output:
writer = csv.writer(output)
for key, value in dict1.items():
writer.writerow(dict1["retrievalid"])
预期专栏
Status
Delivered