title: how can I add r' into variable in python?
body: <p>I have two functions in my program one will take the path from user and another will open the file in that path, this function will open the file </p>
  
  <pre><code>def pdfparser(filename):
      fp = file(filename, 'rb')
  </code></pre>
  
  <p>when I pass the path from another function it returns:</p>
  
  <pre><code>IOError: [Errno 22] invalid mode ('rb') or filename:'C:\\Users\\user\\PycharmProjects\\advisor\\website\\a.PDF
  </code></pre>
  
  <p>I know I have to add double splash to the path or (r'path)
  but my question how can I add r' or double slash into variable since the path will be stored in variable and pass into another function. I need something like s=r'path</p>
  
  <p>any help please     </p>