and relative pathscalling os path abspath(pathwill return string of the absolute path of the argument this is an easy way to convert relative path into an absolute one calling os path isabs(pathwill return true if the argument is an absolute path and false if it is relative path calling os path relpath(pathstartwill return string of relative path from the start path to path if start is not providedthe current working directory is used as the start path try these functions in the interactive shellos path abspath('' :\\users\\al\\appdata\\local\\programs\\python\\python os path abspath(\\scripts'' :\\users\\al\\appdata\\local\\programs\\python\\python \\scriptsos path isabs('false os path isabs(os path abspath(')true since :\users\al\appdata\local\programs\python\python was the working directory when os path abspath(was calledthe "single-dotfolder represents the absolute path ' :\\users\\al\\appdata\\local\\programs\\python\\python enter the following calls to os path relpath(into the interactive shellos path relpath(' :\\windows'' :\\''windowsos path relpath(' :\\windows'' :\\spam\\eggs'\\\windowswhen the relative path is within the same parent folder as the pathbut is within subfolders of different pathsuch as ' :\\windowsand ' :\\spam \\eggs'you can use the "dot-dotnotation to return to the parent folder getting the parts of file path given path objectyou can extract the file path' different parts as strings using several path object attributes these can be useful for constructing new file paths based on existing ones the attributes are diagrammed in figure - reading and writing files