history
old version use
result = commands.getstatusoutput('ls -l')
print result
now use subprocess32
install
sudo apt-get install python-dev
pip install subprocess32
use
#!/usr/bin/env python
import subprocess32 as subprocess;
proc = subprocess.Popen(['grep', '86b45e8625ce', 'arns_file'], stdout=subprocess.PIPE);
result = proc.stdout.read();
print result;