title: Python - print string to screen, include \n in output
body: <p>I have the following code:</p>
  
  <pre><code>pattern = "something.*\n" #intended to be a regular expression
  
  fileString = some/path/to/file
  
  numMatches = len( re.findall(pattern, fileString, 0) )
  
  print "Found ", numMatches, " matches to ", pattern, " in file."
  </code></pre>
  
  <p>I want the user to be able to see the '\n' included in pattern. At the moment, the '\n' in pattern writes a newline to the screen. So the output is like:</p>
  
  <pre><code>Found 10 matches to something.*
   in file.
  </code></pre>
  
  <p>and I want it to be:</p>
  
  <pre><code>Found 10 matches to something.*\n in file.
  </code></pre>
  
  <p>Yes, pattern.replace("\n", "\n") does work. But I want it to print all forms of escape characters, including \t, \e etc. Any help is appreciated.</p>