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
def pdfparser(filename):
fp = file(filename, 'rb')
when I pass the path from another function it returns:
IOError: [Errno 22] invalid mode ('rb') or filename:'C:\\Users\\user\\PycharmProjects\\advisor\\website\\a.PDF
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
any help please