Answers for "how to access a file from root folder in python project"

0

how to access a file from root folder in python project

from from_root import from_root, from_here

# path to config file at the root of your project
# (no matter from what file of the project the function is called!)
config_path = from_root('config.json')

# path to the data.csv file at the same directory where the callee script is located
# (has nothing to do with the current working directory)
data_path = from_here('data.csv')
Posted by: Guest on August-25-2021

Code answers related to "how to access a file from root folder in python project"

Python Answers by Framework

Browse Popular Code Answers by Language