brock@montreat:~/csci373$ python Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> subprocess.call(['ls', '/home/brock/csci373']) code-examples index.shtml lectures-new.shtml~ sched.h commonnav.html labs lectures.shtml stuff commonnav.html~ lectures-new.shtml lectures.shtml~ syllabus.shtml 0 >>> p = subprocess.Popen(['ls', '/home/brock/csci373'], stdout=subprocess.PIPE) >>> print p.communicate() ('code-examples\ncommonnav.html\ncommonnav.html~\nindex.shtml\nlabs\nlectures-new.shtml\nlectures-new.shtml~\nlectures.shtml\nlectures.shtml~\nsched.h\nstuff\nsyllabus.shtml\n', None) >>> p.exit() >>> p = subprocess.Popen(['/bin/cat'], stdin=subprocess.PIPE) >>> p.stdin.write("Are you there?") >>> Are you there? >>> import os >>> new_env = {"LOGNAME" : "brock", "UGH" : "Windows 10" } >>> p = subprocess.Popen([puzzle_bin, "macOS"], env=new_env, stdin=subprocess.PIPE) >>> p.stdin.write(str(p.pid)+'\n') >>> p.wait() 0 >>>