I would like to find the relative path between two directories on my system.
Example:
If I have pathA == <pathA>
and pathB == <pathA>/dir1/dir2
, the relative path between them will be dir1/dir2
.
How could I find it in python? Is there a tool I could use?
If pathB is contained in pathA, I could just do pathB.replace(pathA, '')
to get this relative path, but what if pathB isn't contained in pathA?