title: Python: strip characters line by line from subprocess.Popen
body: <p>Trying to strip characters out of output from the following snippit: <code>subprocess.Popen(cmd,shell=true,stdout=subprocess.PIPE)</code></p>
  
  <p>Longterm i need to split the output into seperate list indexes. Trying to test this with stdout output to validate that its working first. Here is a snippit of the code right now: </p>
  
  <pre><code>#!/usr/bin/env python3.4
  
  import subprocess
  
  def writefile():
    sites = ['blue.com', 'red.com']               
    for site in sites:
      proc = subprocess.Popen(["python dnstwist.py -g " + site + "| sed -e '1,8d' | grep -v -"],shell=True,stdout=subprocess.PIPE,universal_newlines=True)
      while True:
        line = proc.stdout.readline()
        if line!= '':
          print(line.strip('/'))
        else: 
          break
  </code></pre>
  
  <p>I have also tried: </p>
  
  <pre><code>      line = proc.stdout.readline().strip('/')
        if line!= '':
          print(line)
        else: 
          break
  </code></pre>
  
  <p>output always looks like this sample.  Notice the forwardslash is not being stripped out: </p>
  
  <pre><code>Replacement     4ed.com    212.48.70.37/United Kingdom MX:mail.4ed.com
  
  Replacement     r4d.com    69.172.201.208/United States
  </code></pre>
  
  <p>Also it looks like its adding \n or \r. </p>
  
  <p>Longterm i would like it to be something i can parse out to look like the following: </p>
  
  <p><code>{'4ed.com': ['Replacement', '212.48.70.37', 'somewhoisdata', 'United Kingdom'] }</code> </p>
  
  <p>...etc</p>