title: How to send Python variable to curl command for terminal in Google Colaboratory (quotes and '$' doesn't work for curl)
body: <p>This is a followup to this Stackoverflow post</p>
  
  <p><a href="https://stackoverflow.com/questions/52851718/how-to-use-python-variables-in-google-colab-terminal-command">How to use Python variables in Google Colab terminal command?</a></p>
  
  <p>Which asks how to send python variables to the command line. </p>
  
  <p>The answer is you need to place a $ in front of it. In other cases, you need to quote everything like this '$variable'</p>
  
  <p>This works for me except for curl commands. For example</p>
  
  <pre><code>emailBody1 = ' this is some test text'
  
  !curl -X POST 'http://localhost.yxy' -H "Content-Type: application/json" -d '{"emails": [{"emailBody": '$emailBody1'}}'
  </code></pre>
  
  <p>I tried no quotes, single quotes, and double quotes. No quotes results in an error, and single/double quotes just sends whatever is inside as a string; no reference to the variable. </p>