title: Replace two backslashes with a single backslash
body: <p>I want to replace a string with two backslashes with single backslashes. However replace doesn't seem to accept '\\' as the replacement string. Here's the interpreter output:</p>
  
  <pre><code>&gt;&gt;&gt; import tempfile
  &gt;&gt;&gt; temp_folder = tempfile.gettempdir()
  &gt;&gt;&gt; temp_folder
  'C:\\Users\\User\\AppData\\Local\\Temp'
  &gt;&gt;&gt; temp_folder.replace('\\\\', '\\')
  'C:\\Users\\User\\AppData\\Local\\Temp'
  </code></pre>
  
  <p>BTW, I know that Windows paths need to contain either double backslashes or a single forward slashes. I want to replace them anyway for display purposes.</p>