I am trying to replace single quotation marks with double quotation marks in a Python dictionary object so that it works in a shell command. Basically, my dictionary is of this format:
{'PatientID': 'S007', 'PatientName': 'BOND^JAMES', 'PatientBirthDate': 'November'}
and I want it to look like
{"PatientID": "S007", "PatientName": "BOND^JAMES", "PatientBirthDate": "November"}
I have tried using:
patient_dict.replace('\'', '\"')
Which outputs the error message:
AttributeError: 'dict' object has no attribute 'replace'