title: Python Convert Windows File path in a variable
body: <p>Given is a variable that contains a windows file path. I have to then go and read this file. The problem here is that the path contains escape characters, and I can't seem to get rid of it. I checked os.path and pathlib, but all expect the correct text formatting already, which I can't seem to construct.</p>
  
  <p>For example this. Please note that fPath is given, so I cant prefix it with <em>r</em> for a rawpath.</p>
  
  <pre><code>#this is given, I cant rawpath it with r 
  fPath = "P:\python\t\temp.txt"
  
  file = open(fPath, "r")
  for line in file:
      print (line)
  </code></pre>
  
  <p>How can I turn fPath via some function or method from:</p>
  
  <pre><code>"P:\python\t\temp.txt"
  </code></pre>
  
  <p>to</p>
  
  <pre><code>"P:/python/t/temp.txt"
  </code></pre>
  
  <p>I've tried also tried .replace("\","/"), which doesnt work.</p>
  
  <p>I'm using Python 3.7 for this.</p>