I have a python script say “foo_1.py” which resides in folder x and another script foo_2.py which resides in folder y.
Folders x and y are in folder z.
I called a method which belongs to foo_2.py which generates an image in folder y (say img1.png).
Now what I want is to access this img1.png from foo_1.py. How is it possible?
sys.path[0]gives you the directory where the current script resides: