title: run linux grep command from python subprocess
body: <p>I know there are posts already on how to use subprocess in python to run linux commands but I just cant get the syntax correct for this one. please help. This is the command I need to run...</p>
  
  <pre><code>/sbin/ifconfig eth1 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'
  </code></pre>
  
  <p>Ok this is what I have at the moment that gives a syntax error...</p>
  
  <pre><code>import subprocess
  self.ip = subprocess.Popen([/sbin/ifconfig eth1 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'])
  </code></pre>
  
  <p>Any help greatly appreciated.</p>