Getting to the root of your project
![Getting to the root of your project](https://proquickly.ghost.io/content/images/2024/07/programming-background-with-person-working-with-codes-computer-1.jpg)
When programming in python, you sometimes need to access a path off your project root from deep in another directory hierarchy. Here is a really easy way to do it that always works:
import sys
print(sys.path[1])
This way, you can use relative paths from the python file to get to your configuration files, data files, and secrets files. But do make sure you are not pushing your secrets to GitHib and other online repos!