title: TypeError: 'Popen' object is not callable
body: <p>I'm trying to query status of a windows service using subprocess module's 'Popen' method. But I'm getting</p>
  
  <p><strong>TypeError: 'Popen' object is not callable</strong></p>
  
  <pre><code>import subprocess, codecs
  
  def serviceStatus(RadiaService):
      status = []
      cmd = 'sc query ' + RadiaService
      pDetails = subprocess.Popen(cmd, shell = True, stdout = subprocess.PIPE)
      for item in pDetails():
          status.append(item)
      finalStatus = b''.join(status).decode('utf-8')
      print(finalStatus)
  
  if __name__ == '__main__':
      serviceStatus('RCA')
  </code></pre>
  
  <p>Error Trace :</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Alen\Cumulative RHF\Radia_Cumulative_Patch\cumulativeHotFixproject\lib\win32.py", line 39, in &lt;module&gt;
      serviceStatus('RCA')
    File "C:\Alen\Cumulative RHF\Radia_Cumulative_Patch\cumulativeHotFixproject\lib\win32.py", line 33, in serviceStatus
      for item in pDetails():
  TypeError: 'Popen' object is not callable
  </code></pre>