title: 'Popen' object not Iterable
body: <p>I am trying to fetch some Ids into a list via the subprocess command. Below is my code:</p>
  
  <pre><code>list1=[]
  list2=[]
  list1 = subprocess.Popen("pgrep -u root",stdout=subprocess.PIPE, shell = True)
  for i in list1:
      file1 = open(os.path.join('/proc',i,'status')).readlines()
      for line in file1:
          if line.startswith("Mem: "):
               id = int(line.split()[5])
          if line.startswith("Cpu: "):
               toC = int(line.split()[8])
  list2 = (id,toC)
  for k in list2:
      self.text.insert(INSERT,k[0])
      self.text.insert(INSERT,k[1])
  </code></pre>
  
  <p>The error that i get is: 'Popen'object not iterable.
  I am creating a list and fetching the IDs into a list and then for every ID in the list, I am trying to get the mem and cpu information. this information is again input into another empty list(list2). I am iterating over list2 to display these information. Where am I going wrong?</p>