Read File using Relative Path

 file_name = "..//..//data//data//test.txt"

This code will move 2 back folder then look for

data//data/text.txt file.


This way you can navigate to relative folder

while reading any file in python.

Comments

Popular posts from this blog

Reading QR code in Python

Git Command

\r issue in shell script