title: CSV'ify a variable
body: <p>I have a python variable that holds a string ready to be converted into a csv file. This is what my variable contains:-</p>
  
  <pre><code>myvar="ID,Name\n1001,Tania\n1002,Geraldina"
  </code></pre>
  
  <p>How do I make this variables into a csv file? I dont want the "\n"s and the "'s. Instead I want real line breaks.. </p>
  
  <p>EG:This is what I want inside my csv file (myvar.csv)</p>
  
  <pre><code>ID,Name
  1001,Tania
  1002,Geraldina
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>with open("myvar.csv","w+") as out:
      json.dump(myvar,out)
  </code></pre>
  
  <p>But it just inserts the string as is.
  Can anyone point me in the right direction? Thanks in advance. </p>