Get folder name of the file in Python
You can use dirname: os.path.dirname(path) Return the directory name of pathname path. This is the first element of the pair returned by passing path to the function split(). And given the full path, then you can split normally to get the last portion of the path. For example, by using basename: os.path.basename(path) Return the base … Read more