adhg adhg - 10 months ago 53
Python Question

How to access the project root folder

Below is a screenshot of my project. While I can access my

folder quite easily with
I find it tricky to access my 'root' folder

if you see my project explorer, I'm trying to access the
but without specifying the absolute path (i.e.,
) because other developer have different path.

Question: how to access the root
folder with something like this one (doesn't work)

import pandas as pd

csv_result = pd.read_csv("./_files/games.csv") #will not work
csv_result = pd.read_csv("./_files_inner/games.csv") #works

print csv_result

enter image description here

Answer Source

try using ../_files_inner/games.csv