title: How to store os.system() output in a variable or a list in python
body: <p>I am trying to get the output of a command by doing ssh on a remote server using below command.</p>
  
  <pre><code>os.system('ssh user@host " ksh .profile; cd dir; find . -type f |wc -l"')
  </code></pre>
  
  <p>Output of this command is 14549 0</p>
  
  <p>why is there a zero in the output ?
  is there any way of storing the output in variable or list ? I have tried assigning output to a variable and a list too but i am getting only 0 in the variable. I am using python 2.7.3.</p>