Python function translate relative path ../../ into full path
Question: is there a function that translate relative path ../test.txt into a full path?
example:

the full path is:

    
    
    /Users/paganotti/Documents/Project/simple/work/paga/
    

the relative path is:

    
    
    ../test.txt
    

I want build this result:

    
    
    /Users/paganotti/Documents/Project/simple/work/test.txt
    

As you can see translate ../ into "work" folder for build entire path.

Is there general function that acomplish this task?


Answer: use this:

    
    
    import os
    os.path.abspath('../test.txt')
    

[Documentation](http://docs.python.org/library/os.path.html)

