title: I want to replace single quotes with double quotes in a list
body: <p>So I am making a program that takes a text file, breaks it into words, then writes the list to a new text file.</p>
  
  <p>The issue I am having is I need the strings in the list to be with double quotes not single quotes.</p>
  
  <p>For example</p>
  
  <p>I get this <code>['dog','cat','fish']</code> when I want this <code>["dog","cat","fish"]</code></p>
  
  <p>Here is my code</p>
  
  <pre><code>with open('input.txt') as f:
      file = f.readlines()
  nonewline = []
  for x in file:
      nonewline.append(x[:-1])
  words = []
  for x in nonewline:
      words = words + x.split()
  textfile = open('output.txt','w')
  textfile.write(str(words))
  </code></pre>
  
  <p>I am new to python and haven't found anything about this.
  Anyone know how to solve this?</p>
  
  <p>[Edit: I forgot to mention that i was using the output in an arduino project that required the list to have double quotes.]</p>