title: in Python, how can i write from a text file with each word being a different element?
body: <p>i need to use a file in the format:</p>
  
  <pre><code>product1,33,84
  product2,18.50,72
  product3,22,96
  </code></pre>
  
  <p>and need to write the elements to a list in the format:</p>
  
  <pre><code>['product1', '33', '84', 'product2', '18.50', '72', 'product1', '22', '96']
  </code></pre>
  
  <p>However when writing the code, the closest i could get was:</p>
  
  <pre><code>[['product1', '33', '84'], ['product2', '18.50', '72'], ['product1', '22', '96']]
  </code></pre>
  
  <p>using the code:</p>
  
  <pre><code>for line in productList.readlines():
      line = line.replace(",", " ")
      line = line.strip("\n")
      line = line.split(" ")
      products.append(line)
  </code></pre>
  
  <p>how can i either write by element or merge these nested lists?</p>