title: List to str adding backslash \ to string using str()
body: <p>I am trying to extract file paths from a txt file. My file says C:\logs.
  I use </p>
  
  <pre><code>with open(pathfile, "r") as f:
      pathlist = f.readlines()
  </code></pre>
  
  <p>to produce a list with the path in, and then</p>
  
  <pre><code>path1 = str(pathlist)
  </code></pre>
  
  <p>to produce the line as a string. The list sees the line as it is in th efile, but te second command puts in an extra backslash: C:\logs.</p>
  
  <p>I then do </p>
  
  <pre><code>os.chdir(path1)
  </code></pre>
  
  <p>to look at the path and I get the error</p>
  
  <blockquote>
    <p>WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: "['C:\\logs']"</p>
  </blockquote>
  
  <p>WHY is this? how can I prevent it?</p>
  
  <p>I am looking to have many paths in the file and have the script search each path individually. Is this the best way to do it? </p>
  
  <p>Thank you very much.</p>