Dict一个值我可以将它附加到csv。我想追加dict 2值。我该如何处理

时间:2017-12-08 06:44:42

标签: python csv

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

0 个答案:

没有答案