Python function translates relative path ../../ to full path
is there a function that translates the relative path .. /test.txt into a full path? Example:
I want to plot this result:
As you can see translate ../ into the "work" folder to create the whole path.
Is there a general function that accomplishes this task?
source to share