1👍
✅
If you need to go up by one more directory, then you can join another os.pardir
to the current directory:
os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
Source:stackexchange.com