Absolute Path from Relative Path
suggest changeUse os.path.abspath
:
>>> os.getcwd()
'/Users/csaftoiu/tmp'
>>> os.path.abspath('foo')
'/Users/csaftoiu/tmp/foo'
>>> os.path.abspath('../foo')
'/Users/csaftoiu/foo'
>>> os.path.abspath('/foo')
'/foo'
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents