and os path basename(and placing their return values in tuple(os path dirname(calcfilepath)os path basename(calcfilepath)(' :\\windows\\system ''calc exe'but os path split(is nice shortcut if you need both values alsonote that os path split(does not take file path and return list of strings of each folder for thatuse the split(string method and split on the string in os sep (note that sep is in osnot os path the os sep variable is set to the correct folder-separating slash for the computer running the program'\\on windows and '/on macos and linuxand splitting on it will return list of the individual folders for exampleenter the following into the interactive shellcalcfilepath split(os sep[' :''windows''system ''calc exe'this returns all the parts of the path as strings on macos and linux systemsthe returned list of folders will begin with blank stringlike this'/usr/binsplit(os sep['''usr''bin'the split(string method will work to return list of each part of the path finding file sizes and folder contents once you have ways of handling file pathsyou can then start gathering information about specific files and folders the os path module provides functions for finding the size of file in bytes and the files and folders inside given folder calling os path getsize(pathwill return the size in bytes of the file in the path argument calling os listdir(pathwill return list of filename strings for each file in the path argument (note that this function is in the os modulenot os path here' what get when try these functions in the interactive shellos path getsize(' :\\windows\\system \\calc exe' os listdir(' :\\windows\\system '[' '' cpx'' cpx'' ax''aaclient dll'--snip-'xwtpdui dll''xwtpw dll''zh-cn''zh-hk''zh-tw''zipfldr dll'