title: Remove commas and newlines from text file in python
body: <p>I have text file which looks like this:</p>
  
  <pre><code>ab initio
  ab intestato
  ab intra
  a.C.
  acanka, acance, acanek, acankach, acankami, acanką
  Achab, Achaba, Achabem, Achabie, Achabowi
  </code></pre>
  
  <p>I would like to pars every word separated by comma into a list. So it would look like <code>['ab initio', 'ab intestato', 'ab intra','a.C.', 'acanka', ...]</code> Also mind the fact that there are words on new lines that are not ending with commas.
  When I used 
  <code>list1.append(line.strip())</code> it gave me string of every line instead of separate words. Can someone provide me some insight into this?</p>
  
  <p>Full code below:</p>
  
  <pre><code>list1=[]
  filepath="words.txt"
  with open(filepath, encoding="utf8") as fp:  
     line = fp.readline()
     while line:
         list1.append(line.strip(','))
         line = fp.readline()
  </code></pre>