title: Strip outside quotes from text when writing to list in Python
body: <p>I have a text file that looks like this when opened as file:</p>
  
  <pre><code>'element1', 'element2', 'element3', 'element4'
  </code></pre>
  
  <p>I then use a list comprehension to read this into a list </p>
  
  <pre><code>thelist = [line.strip() for line in open('file.txt', 'r')]
  </code></pre>
  
  <p>But the list looks like this with only one element at index 0</p>
  
  <pre><code>["'element1', 'element2', 'element3', 'element4'"]
  </code></pre>
  
  <p>Since the double quotes are appended to the ends of the first and last elements, python thinks it is a single element list. Is there a way to use the "strip()" inside the list comprehension to remove those outside double quotes?</p>