title: How to execute awk command by python code
body: <p>I've had a set of data which I want to deal with. I was trying to run a python code to execute "awk" command in linux. hoverver no matter how I try different arguments or functions, it all didn't work.  </p>
  
  <p>there are two different way in which I have tried, but they all didn't work. I don't know why  </p>
  
  <p>1)</p>
  
  <pre><code>#!/usr/bin/env python
  import subprocess as sp
  cmd = "awk, '{print $2 '\t' $4 '\t' $5 '\t' $6}', B3LYPD.txt"
  args = cmd.split(',')
  p = sp.Popen(args, stdin = sp.PIPE, stdout = sp.PIPE, stderr = sp.PIPE )
  </code></pre>
  
  <p>2)</p>
  
  <pre><code>#!/usr/bin/env python
  import subprocess as sp
  cmd = "awk, '{print $2 '\t' $4 '\t' $5 '\t' $6}'"
  args = cmd.split(',')
  p = sp.Popen(args, stdin = sp.PIPE, stdout = sp.PIPE, stderr = sp.PIPE )
  c = p.communicate('B3LYPD.txt')
  print c
  </code></pre>