title: Python: String on Single Line
body: <p>This seems like a relatively simple thing to do, and i've tried a few solutions I've found on here but nothing seems to work. I am trying to remove all <code>\n</code>s from a string in order to have everything on one line. After researching, I thought</p>
  <pre><code>jsfile = jsfile.replace(&quot;\n&quot;, &quot; &quot;)
  jsfile = jsfile.replace(&quot;\n\n&quot;, &quot; &quot;)
  jsfile = jsfile.replace(&quot;\t&quot;, &quot; &quot;)
  </code></pre>
  <p>Would work, but I still can't get the string into one line. The issue here is when I try to turn the string into JSON it gives me errors as it's not valid JSON (using json.load as a test here).</p>
  <p>Current Output:</p>
  <pre><code>{&quot;name&quot;: &quot;aName&quot;, &quot;description&quot;: &quot;a description that
  doesn't want to 
  stay on one line&quot;, &quot;address&quot;: &quot;anAddress&quot;}
  </code></pre>
  <p>Output I want:</p>
  <pre><code>{&quot;name&quot;: &quot;aName&quot;, &quot;description&quot;: &quot;a description that doesn't want to stay on one line&quot;, &quot;address&quot;: &quot;anAddress&quot;}
  </code></pre>