Convert single quotes to double quotes for Dictionary key/value pair
<p>I have a dictionory with key value pair in single inverted commas as follows:</p>

<pre><code>filename = 'sub-310621_task-EMOTION_acq-LR_bold.nii.gz'
intended_for ={"IntendedFor", filename}
</code></pre>

<p>AS i am want to write this dictionary to a json file i have to have filename in between two inverted commas eg: <code>"sub-310621_task-EMOTION_acq-LR_bold.nii.gz"</code></p>

<p>SO the output should look like:</p>

<pre><code>intended_for ={"IntendedFor", "sub-310621_task-EMOTION_acq-LR_bold.nii.gz"}
</code></pre>

<p>This output will be written in to test.json file which should look like:</p>

<pre><code>{
    "IntendedFor": "sub-310621_task-EMOTION_acq-LR_bold.nii.gz"
}
</code></pre>

<p>How can i do this in python ?</p>