python absolute path from projectr 1

python absolute path from projectr

ROOT_DIR = os.path.dirname(os.path.abspath("top_level_file.txt"))

Here is what the above code is Doing:
1. We’re importing the os module.
2. We’re setting the BASE_DIR variable to the path of the directory that contains the top_level_file.txt file.
3. We’re setting the PROJECT_ROOT_DIR variable to the path of the directory that contains the top_level_file.txt file.

Similar Posts