title: Python -- variable manipulation string.replace()?
body: <p>Sorry if I'm going down the wrong path...  I tried to search for a solution for the past couple days, and not sure if I'm searching the right topic.</p>
  
  <p>I'm trying to do an useradd script, and I'm getting close.  However, I'm stuck on the following:</p>
  
  <pre><code>&gt;&gt;&gt; HASH_PASSWORD = '$1$AMWteFb7$pD/0oisRcD.6lSvtrjNmb1'
  &gt;&gt;&gt; print HASH_PASSWORD
  $1$AMWteFb7$pD/0oisRcD.6lSvtrjNmb1
  &gt;&gt;&gt; HASH_PASSWORD = HASH_PASSWORD.replace("\$","\\\$")
  &gt;&gt;&gt; print HASH_PASSWORD
  $1$AMWteFb7$pD/0oisRcD.6lSvtrjNmb1
  </code></pre>
  
  <p>I just need to add a "\" in front of the "$".  Can't seem to find a way to do that.</p>
  
  <p>Thanks in advance for all your help.</p>