on windowswe need to pass shell=true argument to subprocess tools like call and popen (shown aheadin order to run commands built into the shell windows commands like "typerequire this extra protocolbut normal executables like "pythondo not on unix-like platformswhen shell is false (its default)the program command line is run directly by os execvpa call we'll meet in if this argument is truethe command-line string is run through shell insteadand you can specify the shell to use with additional arguments more on some of this laterfor nowit' enough to note that you may need to pass shell=true to run some of the examples in this section and book in unix-like environmentsif they rely on shell features like program path lookup since ' running code on windowsthis argument will often be omitted here besides imitating os systemwe can similarly use this module to emulate the os popen call used earlierto run shell command and obtain its standard output text in our scriptpipe subprocess popen('python helloshell py'stdout=subprocess pipepipe communicate(( 'the meaning of life\ \ 'nonepipe returncode herewe connect the stdout stream to pipeand communicate to run the command to completion and receive its standard output and error streamstextthe command' exit status is available in an attribute after it completes alternativelywe can use other interfaces to read the command' standard output directly and wait for it to exit (which returns the exit status)pipe subprocess popen('python helloshell py'stdout=subprocess pipepipe stdout read( 'the meaning of life\ \npipe wait( in factthere are direct mappings from os popen calls to subprocess popen objectsfrom subprocess import popenpipe popen('python helloshell py'stdout=pipecommunicate()[ 'the meaning of life\ \nimport os os popen('python helloshell py'read('the meaning of life\nas you can probably tellsubprocess is extra work in these relatively simple cases it starts to look betterthoughwhen we need to control additional streams in flexible ways in factbecause it also allows us to process command' error and input streams system tools