the filecmp module can be used to compare files with the filecmp cmp(function and to compare entire directories with the filecmp cmpfiles(function one very powerful and effective use of python programs is to orchestrate the running of other programs this can be done using the subprocess module which can start other processescommunicate with them using pipesand retrieve their results this module is covered in an even more powerful alternative is to use the multiprocessing module which provides extensive facilities for offloading work to multiple processes and for accumulating resultsand can often be used as an alternative to multithreading the os module provides platform-independent access to operating system functionality the os environ variable holds mapping object whose items are environment variable names and their values the program' working directory is provided by os getcwd(and can be changed using os chdir(the module also provides functions for low-level file-descriptor-based file handling the os access(function can be used to determine whether file exists or whether it is readable or writableand the os listdir(function returns list of the entries ( the files and directoriesbut excluding the and entries)in the directory it is given the os stat(function returns various items of information about file or directorysuch as its modeaccess timeand size directories can be created using os mkdir()or if intermediate directories need to be createdusing os makedirs(empty directories can be removed using os rmdir()and directory trees that contain only empty directories can be removed using os removedirs(files or directories can be removed using os remove()and can be renamed using os rename(the os walk(function iterates over an entire directory treeretrieving the name of every file and directory in turn the os module also provides many low-level platform-specific functionsfor exampleto work with file descriptorsand to fork (only on unix systems)spawnand exec whereas the os module provides functions for interacting with the operating systemespecially in the context of the file systemthe os path module provides mixture of string manipulation (of paths)and some file system convenience functions the os path abspath(function returns the absolute path of its argumentwith redundant path separators and elements removed the os path split(function returns -tuple with the first element containing the path and the second the filename (which will be empty if path with no filename was giventhese two parts are also available directly using os path basename(and os path dirname( filename can also be split into two partsname and extensionusing os path splitext(the os path join(function takes any number of path strings and returns single path using the platform-specific path separator