I want to get the current file\'s directory path. I tried:
>>> os.path.abspath(__file__) \'C:\\\\python27\\\\test.py\'
But how can
Let's assume you have the following directory structure: -
main/ fold1 fold2 fold3...
folders = glob.glob("main/fold*") for fold in folders: abspath = os.path.dirname(os.path.abspath(fold)) fullpath = os.path.join(abspath, sch) print(fullpath)