how to get the relative path of a file in python code example Example: relative path python import sys,os sys.path.append(os.path.realpath('..'))