Simple trick to work with relative paths in Python
Calculate the file path at runtime with ease
Published in
5 min readOct 25, 2021
The goal of this article is to calculate a path to a file in a folder in your project. The reason we calculate this path is that you refer to the correct location no matter where the code is installed. This is the case when you share your code with a coworker or deploy your code on a webserver e.g.