and os popen calls which were available in python xthese are now just use cases for subprocess object interfaces because more advanced use cases for this module deal with standard streamswe'll postpone additional details about this module until we study stream redirection in the next shell command limitations before we move onyou should keep in mind two limitations of system and popen firstalthough these two functions themselves are fairly portabletheir use is really only as portable as the commands that they run the preceding examples that run dos dir and type shell commandsfor instancework only on windowsand would have to be changed in order to run ls and cat commands on unix-like platforms secondit is important to remember that running python files as programs this way is very different and generally much slower than importing program files and calling functions they define when os system and os popen are calledthey must start brandnewindependent program running on your operating system (they generally run the command in new processwhen importing program file as modulethe python interpreter simply loads and runs the file' code in the same process in order to generate module object no other program is spawned along the way ss there are good reasons to build systems as separate programstooand in the next we'll explore things such as command-line arguments and streams that allow programs to pass information back and forth but in many casesimported modules are faster and more direct way to compose systems if you plan to use these calls in earnestyou should also know that the os system call normally blocks--that ispauses--its caller until the spawned command line exits on linux and unix-like platformsthe spawned command can generally be made to run independently and in parallel with the caller by adding an shell background operator at the end of the command lineos system("python program py arg arg &"on windowsspawning with dos start command will usually launch the command in parallel tooos system("start program py arg arg"ss the python code exec(open(fileread()also runs program file' codebut within the same process that called it it' similar to an import in that regardbut it works more as if the file' text had been pasted into the calling program at the place where the exec call appears (unless explicit global or local namespace dictionaries are passedunlike importssuch an exec unconditionally reads and executes file' code (it may be run more than once per process)no module object is generated by the file' executionand unless optional namespace dictionaries are passed inassignments in the file' code may overwrite variables in the scope where the exec appearssee other resources or the python library manual for more details introducing the os module