working with paths rename(targetrename this file or directory to the given target unlink(removes the file referenced by the path object joinpath(*otherappends elements to the path object path joinpath('temp'with_name(new_namereturn new path object with the name changed the '/operator can also be used to create new path objects from existing paths for example path'test''outputwhich would append the directories test and out to the path object two path class methods can be used to obtain path objects representing key directories such as the current working directory (the directory the program is logically in at that pointand the home directory of the user running the programpath cwd(return new path object representing the current directory path home(return new path object representing the user' home directory an example using several of the above features is given below this example obtains path object representing the current working directory and then appends 'textto this the result path object is then checked to see if the path exists (on the computer running the program)assuming that the path does not exist it is created and the exists(method is rerun path cwd(print('set up new directory'newdir 'testprint('check to see if newdir exists'print('newdir exists():'newdir exists()print('create new dir'newdir mkdir(print('newdir exists():'newdir exists()the effect of creating the directory can be seen in the outputset up new directory check to see if newdir exists newdir exists()false create new dir newdir exists()true very useful method in the path object is the glob(patternmethod this method returns all elements within the path that meet the pattern specified for example path glob('py'will return all the files ending py within the current path