#!/usr/bin/python
## get subprocess module
import subprocess
## call date command ##
p = subprocess.Popen(“date”, stdout=subprocess.PIPE, shell=True)
## Talk with date command i.e. read data from stdout and stderr. Store this info in tuple
## I
import subprocess
output =Popen([“mycmd”,”myarg”], stdout=PIPE).communicate()[0]
import subprocess
p = subprocess.Popen([‘ls’,’-a’], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
print out
# work on Unix/Linux only
imp