title: Passing a Python string into JSON payload
body: <p>I have this in my code:</p>
  
  <pre><code>targetTemp = 17
  ...
  payload = "{\n    \"nodes\": [{\n        \"attributes\": {\n            \"targetHeatTemperature\": {\n                \"targetValue\": '+ targetTemp +',\n            }\n        }\n    }]\n}"
  </code></pre>
  
  <p>I've tried a few things I've found online but nothing seems to work.  If I replace '+ targetTemp +', with, say, 18 then it does what I want.</p>
  
  <p>I've tried just with single quotes and no plus signs, just the variable name, without the comma at the end.  I'm just stumbling round in the dark, really.</p>