with open('dateHelp.log', 'w') as dateLog:
    with open('dateHelp.err', 'w') as errLog:
        dateHelp = subprocess.Popen(['date', '-h'], stdout=dateLog, stderr=
            errLog)
dateHelp.communicate()
Running subprocess within different virtualenv with python