this distinction between the cwd and import search paths explains why many scripts in this book designed to operate in the current working directory (instead of one whose name is passed inare run with command lines such as this onec:\temppython :\pp \tools\cleanpyc py process cwd in this examplethe python script file itself lives in the directory :\pp \toolsbut because it is run from :\tempit processes the files located in :\temp ( in the cwdnot in the script' home directoryto process files elsewhere with such scriptsimply cd to the directory to be processed to change the cwdc:\tempcd :\pp thed\examples :\pp thed\examplespython :\pp \tools\cleanpyc py process cwd because the cwd is always implieda cd command tells the script which directory to process in no less certain terms than passing directory name to the script explicitlylike this (portability noteyou may need to add quotes around the py in this and other command-line examples to prevent it from being expanded in some unix shells) :\pp \toolspython find py py :\temp process named dir in this command linethe cwd is the directory containing the script to be run (notice that the script filename has no directory path prefix)but since this script processes directory named explicitly on the command line ( :\temp)the cwd is irrelevant finallyif we want to run such script located in some other directory in order to process files located in yet another directorywe can simply give directory paths to bothc:\temppython :\pp \tools\find py cxx :\pp thed\examples\pp herethe script has import visibility to files in its pp \tools home directory and processes files in the directory named on the command linebut the cwd is something else entirely ( :\tempthis last form is more to typeof coursebut watch for variety of cwd and explicit script-path command lines like these in this book command-line arguments the sys module is also where python makes available the words typed on the command that is used to start python script these words are usually referred to as commandline arguments and show up in sys argva built-in list of strings programmers may notice its similarity to the argv array (an array of stringsit' not much to look at interactivelybecause no command-line arguments are passed to start up python in this modeimport sys sys argv ['' script execution context