python get root directory code example
Example 1: python how to get project location
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
Example 2: Python project root dir
import os
ROOT_DIR = os.path.abspath(os.curdir)
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
import os
ROOT_DIR = os.path.abspath(os.curdir)