Answers for "how to read file over two directory back"

0

how to read file over two directory back

. = current directory
.. = parent directory
../ = gets you one directory back.
Chain ../ as many times as necessary to go up 2 or more levels.
------------------------------------------------------------------------
For example this is directory tree
parent
|-sub_parent
| |-current
|   |-working.py <-(file you are in)
|-index.csv

You are in working.py and you want to read index.php, you can chani "../" like this.
data = pd.read_csv('../../index.csv')
Posted by: Guest on September-28-2021

Code answers related to "how to read file over two directory back"

Browse Popular Code Answers by Language